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