-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hopefully final version of the intro
- Loading branch information
1 parent
5106eae
commit 0c8e9f0
Showing
3 changed files
with
78 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,80 @@ | ||
# Introduction | ||
|
||
This is a small example that shows how to use the badge as an actual badge with a little game as a bonus. | ||
This is a short introduction containing some information and a small example meant to show how to use the badge. | ||
|
||
## What's Inside | ||
**It is strongly recommended you read through this entire document.** | ||
|
||
See `src/hello.zig` and tweak the the values to your liking. | ||
## Quick Badge Facts | ||
|
||
## Running | ||
The badge is based on the PyBadge and is equipped with: | ||
|
||
## On the simulator | ||
- A 32-bit ARM CPU | ||
- A light sensor | ||
- A 160x128 16-bit RGB (RGB565) screen | ||
- 5 24-bit RGB LEDs | ||
- 1 red LED on the back | ||
- A speaker | ||
- Start/option buttons | ||
- A/B buttons | ||
- A navstick/d-pad with up/down/left/right + click | ||
- 2MB flash separate from the microcontroller's flash | ||
|
||
## Setup | ||
|
||
Install Zig 0.12.0. You can find [the binaries on the Zig website](https://ziglang.org/download/#release-0.12.0), or obtain them via a version manager such as [`zigup`](https://github.com/marler8997/zigup). | ||
|
||
Clone this repository and enter this directory: | ||
|
||
```bash | ||
git clone https://github.com/ZigEmbeddedGroup/sycl-badge | ||
cd sycl-badge | ||
cd docs/introduction | ||
``` | ||
|
||
## The Example | ||
|
||
See `src/hello.zig` and tweak the the values to your liking. I recommend quickly altering the `hello.zig` example a first time and following the rest of these instructions and then going back to modify it some more, if you'd like. | ||
|
||
### Running on the simulator | ||
|
||
The simulator is ideal for fast iteration as it supports live reloading. | ||
|
||
Run `zig build watch` and head to https://badgesim.microzig.tech/. | ||
Run `zig build watch` and head over to https://badgesim.microzig.tech/. | ||
|
||
(It's been noted that the live reloaders may be a little finnicky. If they don't work at all, please let Auguste know.) | ||
|
||
Once you're happy with what you've made, read on to learn how to flash your code onto the badge! | ||
|
||
## Hard(ware) mode | ||
|
||
### Power and Boot | ||
|
||
Your badge can be powered via the USB-C port, but to allow cordless use of the badge, you've been provided with a battery and two pieces of velcro. | ||
|
||
Place one piece of velcro on the back of the board where space has been left available, and the other piece of velcro on the battery. Then plug the connector on the battery into the similar connector on the back of the board. Finally, attach the battery's velcro to the board's. | ||
|
||
Once the battery is connected, it can be charged via the USB-C port. **PLEASE BE CAREFUL** about leaving your badge charging for too long as the batteries/battery controller are not necessarily production ready. They should pose little risk, but it's better to be safe than sorry. | ||
|
||
There is an on/off switch located at the top of the badge. Try booting the badge now if you haven't already! | ||
|
||
### Uploading | ||
|
||
Run `zig build`, then find `hello.uf2` in the `zig-cache/zig-out/firmware` directory. | ||
|
||
Plug in your badge. It should appear as a mass storage device/USB drive. | ||
|
||
Copy `hello.uf2` in place of the `CURRENT.UF2` present on the badge USB drive. | ||
|
||
Your program will run immediately. | ||
|
||
### Resetting | ||
|
||
You'll find a brass colored button on the back of the board, at the top. This is the reset button. Press it once to restart your program and twice to go back to the bootloader and upload a new program. | ||
|
||
## Need help? | ||
|
||
## On hardware | ||
Please ask someone with a staff badge (most likely Auguste) - we'd be happy to help! | ||
|
||
Once you're happy with what you've made, you'll need to flash it onto your badge! | ||
If you can't locate one of us, please post in the Discord thread and we'll get back to you as fast as possible! | ||
|
||
TODO | ||
## Have fun! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters