96 lines
2.7 KiB
Markdown
96 lines
2.7 KiB
Markdown
# AutoBar
|
|
|
|
Automatic bartender machine running on a Raspberry Pi Pico/W
|
|
|
|
Copyright Wyatt Miller, Avery Miller 2022
|
|
|
|
## Table of Contents
|
|
|
|
- [Overview](#overview)
|
|
- [Building](#building)
|
|
- [Installing](#installing)
|
|
|
|
## Overview
|
|
|
|
TODO
|
|
|
|
## Building
|
|
|
|
### Requirements
|
|
|
|
You'll need the following to be able to build this:
|
|
|
|
- [git](https://git-scm.com/)
|
|
- C/C++ compiler (supporting C11 and C++17)
|
|
- Rust 1.59 or greater
|
|
- [Pico SDK](https://github.com/raspberrypi/pico-sdk)
|
|
|
|
### 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):
|
|
|
|
```bash
|
|
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:
|
|
|
|
```bash
|
|
export PICO_SDK_PATH=../pico-sdk/
|
|
```
|
|
|
|
Alternatively, you can run the following in Powershell if you're on Windows:
|
|
|
|
```powershell
|
|
$Env:PICO_SDK_PATH = "../pico-sdk"
|
|
```
|
|
|
|
Run that command when you're in the `AutoBar` directory.
|
|
|
|
### Installation of requirements
|
|
|
|
###### Fedora Linux
|
|
|
|
First, install a C/C++ compiler and git. Install via `dnf`:
|
|
|
|
```bash
|
|
sudo dnf install gcc gcc-c++ git
|
|
```
|
|
|
|
Install Rust, `rustc` and `cargo` via rustup:
|
|
|
|
```bash
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
|
```
|
|
|
|
###### Windows
|
|
|
|
First, install [MinGW](https://osdn.net/projects/mingw/downloads/68260/mingw-get-setup.exe/) for a C/C++ compiler. Download and follow the installer.
|
|
|
|
Next, install [git](https://git-scm.com/). Download and follow the installer.
|
|
|
|
Finally, install Rust, `rustc` and `cargo` via [rustup](https://win.rustup.rs/x86_64). 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.
|
|
|