diff --git a/README.md b/README.md index ec100a2..c73a9ee 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,11 @@ -# SYCL 2024 PCB Badge +# Software You Can Love Badge -## Getting Started +Welcome to the SYCL badge repo! -Check out the [Introduction](docs/introduction/README.md)! +## Get started with the [Introduction](docs/introduction/README.md)! + + diff --git a/docs/introduction/README.md b/docs/introduction/README.md index 6b541b2..af7978a 100644 --- a/docs/introduction/README.md +++ b/docs/introduction/README.md @@ -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! diff --git a/src/watch/main.zig b/src/watch/main.zig index a0908f4..9aaa8bf 100644 --- a/src/watch/main.zig +++ b/src/watch/main.zig @@ -6,9 +6,9 @@ const Reloader = @import("Reloader.zig"); const assert = std.debug.assert; const log = std.log.scoped(.server); -// pub const std_options: std.Options = .{ -// .log_level = .err, -// }; +pub const std_options: std.Options = .{ + .log_level = .err, +}; const usage = \\usage: zine serve [options]