https://github.com/roboticsbrno/logic-serial
https://github.com/roboticsbrno/logic-serial
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/roboticsbrno/logic-serial
- Owner: RoboticsBrno
- License: mit
- Created: 2022-07-19T19:44:16.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-07-19T20:04:18.000Z (almost 4 years ago)
- Last Synced: 2025-02-08T23:26:04.898Z (over 1 year ago)
- Language: C++
- Homepage: https://2022.robotickytabor.cz/microbit/logic/
- Size: 3.91 KB
- Stars: 0
- Watchers: 8
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# logic-serial
An example making Logic board into a serial-connected peripheral.
Serial interface is connected to gpio 5 (rx) and 2 (tx).
## Protocol
All communication is text-based. The program expects line-separated commands and sends line-separated events. Arguments are separated by spaces.
### Commands
- `set `
- set led at coordinates `x`, `y` to color `Rgb(red, green, blue)`
- `show`
- show the current state of the leds
- `clear`
- turn off all leds
- `set_status `
- set the status led at index `index` to color `Rgb(red, green, blue)`
- `show_status`
- show the current state of the status leds
- `clear_status`
- turn off all status leds
- `set_buzzer `
- set the buzzer to state `state` (0 or 1)
### Events
- `pressed `
- a button with id `id` was pressed
- `released `
- a button with id `id` was released
Button ids come in sequence starting from top to bottom, left to right,
e.g. top left (0), top right (1), bottom left (2), bottom right (3), arrow up (4), arrow left (5), center (6), arrow right (7), arrow down (8).