A Trinket firmware that sets the tiny board as a HID device, so it's possible to send and receive messages via USB.
The sketch implements a very simple protocol:
- send 0 or 1 (as an unsigned char) to turn pin 2 off/on
- receive 0 or 1 (as an unsigned char) whenever pin 2 changes state
The LED connected to pin 1 turns on/off to show pin 2 status; it also blinks when the Trinket receives a ping message (any byte different from 0 or 1).
GPL v.3