3.2 KiB
AutoBar
Automatic bartender machine running on a Raspberry Pi Pico/W
Copyright Wyatt Miller, Avery Miller 2022 Licensed by the Mozilla Public License v2
Table of Contents
Overview
TODO
Building
Requirements
You'll need the following to be able to build this:
- git
- C/C++ compiler (supporting C11 and C++17)
- cmake
- Rust 1.59 or greater
- Pico SDK
If you're on Linux, use your appropriate package manager, such as apt, dnf, yum, or zypper. Most modern versions of Linux that are supported will install these.
If you're on Windows, please follow the links and use the given installers/scripts from the websites above.
Clone
First, grab the Pico SDK from the link above via git clone
. You'll need this when it comes to building.
Clone the repository by running the following (or using your favorite git client):
git clone https://scm.wyattjmiller.com/wymiller/AutoBar/
Make sure that the Pico SDK and the AutoBar repositories are sitting side-by-side. This is needed because you have to set the PICO_SDK_PATH
environment variable and the settings require that the repositories need to be set that way. You can do this in Linux by running the following:
export PICO_SDK_PATH=../pico-sdk/
Alternatively, you can run the following in Powershell if you're on Windows:
$Env:PICO_SDK_PATH = "../pico-sdk"
Run the above Powershell command when you're in the AutoBar
directory (again, if you're running on Windows).
Installation of requirements
Fedora Linux
First, install a C/C++ compiler and git. Install via dnf
:
sudo dnf install gcc gcc-c++ git
Install Rust, rustc
and cargo
via rustup:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Windows
First, install MinGW for a C/C++ compiler. Download and follow the installer.
Next, install git. Download and follow the installer.
Finally, install Rust, rustc
and cargo
via rustup. We assume the Windows installation is running amd64
hardware.
Building (for real this time)
Run the following commands in sequential order in the root of the AutoBar directory:
cargo build --manifest-path libautobar/Cargo.toml --target thumbv6m-none-eabi -r
cmake .
make
The first command invokes the cargo
command, which builds the Rust library.
The next command invokes cmake
. It's not really a build system per se but it generates a Makefile
for us to use make
.
Speaking of which, the last command that's invoked is make
which links the library and executable together and builds them.
Installing
Press the BOOTSEL button on the RP Pico until you get the RP Pico to show up as a mass storage device on your computer. From there, you can drag the autobar.uf2
from the root of the AutoBar directory to the root of the RP Pico. It should run automatmically once that is done.