Kiibohd Controller
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

exampleAPI.bash 1.2KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/usr/bin/env bash
  2. # ISSILed
  3. # Virtual Serial Port API Example
  4. # Jacob Alexander 2015
  5. if [ $# -eq 0 ]; then
  6. echo "You must specify your virtual serialport. (/dev/ttyACM0 on linux, /dev/cu.usbmodemXXXX on OSX)"
  7. echo " ex: $0 /dev/ttyACM0"
  8. exit 1
  9. fi
  10. # XXX Set this to match your virtual serialport
  11. # TODO Show examples for Cygwin/Windows
  12. # For Mac OSX it will be something like /dev/cu.usbmodem1413 (number may differ)
  13. SERIALPORT=$1
  14. # NOTE: Make sure you don't write too quickly to the serial port, it can get overwhelmed by a modern computer
  15. # Generally this just means commands will get ignored
  16. # I'm using 100 ms sleeps here, but much smaller are probably sufficient
  17. # Clear out cli buffer
  18. printf "\r" > $SERIALPORT
  19. # Write to ISSI Page
  20. # Arguments
  21. # - page
  22. # - starting address
  23. # - data (usually brightness) (8 bits)
  24. #
  25. # For brightness control, set the starting address to 0x24
  26. # By default only page 0x00 is used
  27. # There are 8 pages of memory (these can be cycled through for animiations)
  28. # 144 led channels
  29. # Page 0x0A is used for configuration
  30. # See the datasheet for full details http://www.issi.com/WW/pdf/31FL3731C.pdf
  31. sleep 0.1
  32. printf "ledWPage 0x00 0x24 0x10 0x20 0x30 0x40 0x50\r" > $SERIALPORT