Skip to content

Commit

Permalink
Hopefully final version of the intro
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperAuguste committed May 14, 2024
1 parent 5106eae commit 0c8e9f0
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 16 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)!

<!--
Useful information but I think it might confuse folks.
## Uploading firmware using a debugger
Expand All @@ -19,4 +22,4 @@ file zig-out/firmware/pybadge-io.elf
```
sudo dfu-util -a 0 --dfuse-address 0x08000000:leave -R -D ~/Downloads/blackmagic-firmware-v1.10.0-rc1/blackpill-f401cc/blackmagic-blackpill-f401cc.bin ^C
```
```-->
77 changes: 68 additions & 9 deletions docs/introduction/README.md
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!
6 changes: 3 additions & 3 deletions src/watch/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 0c8e9f0

Please sign in to comment.