aforren1 / hand

1 stars 1 forks source link

To use via PlatformIO:

  1. Install platformio-ide (via visual studio code or atom?)
    • The Arduino IDE + Teensyduino could work, but it's a bit more effort to get C++11/standard library support
  2. clone this directory (git clone --recursive https://github.com/aforren1/hand)
  3. Open the directory in the text editor of choice
  4. Hit Ctrl+Shift+P and find "PlatformIO: New Terminal"
  5. In that terminal, type platformio init --board teensy35
  6. To compile & link, platformio run
  7. To upload to the board, platformio run --target upload (add -e teensy35_serial_dbg to target the serial env)
  8. To clean up files (sometimes helps in development), platformio run --target clean

Notes:

Commands:

Config mode

Below are examples of packets that might be sent, and the results:

b'a' # change to acquisition mode (sampling) (only from config mode)
b'c' # change to config mode (no sampling) (only from acquisition mode)
# can only do the following in config mode:
b'sf' + struct.pack('>f', 1000.0) # set the sampling frequency to 1000 Hz
b'sm' + struct.pack('B', 1) # turn on game mode
b'sg' + struct.pack('>bbbf', -1, -1, 3, 48.0) # set the product of gains across all fingers & channels to 48.0
b'gg' + struct.pack('bbb', 0, 1, 2) # see how that changed the first finger, second channel, output gain