|
initialize your serial port to: |
57600 bps, 8 data bits, 1 stop bit, no parity bit |
to get an analog
to digital conversion: |
send out "A" (ascii 65)
send out line number as ASCII character, range= 0 through 7
read back the result, which will be an ASCII char from 0 to 255 |
|
to read a single input line: |
send out "r" (ascii 114)
send out line number as ASCII character, range=0 through 9
read back the result, which will be an ASCII char, either 0 or 1. |
to read the first eight input
lines as an 8-bit port: |
send out "R" (ascii 82)
read back the result, which will be an ASCII char from 0 to 255 |
|
to write a single output line: |
send out "w" (ascii 119)
send out line number as ASCII character, range=0 through 9
send out the state as an ASCII char, either 0 for off or 1 for on |
|
to write the first eight output lines as an 8-bit port: |
send out "W" (ascii 87)
send out the state as an ASCII char from 0 to 255 |
|
to set the pulse-width-modulation duty cycle (PWM): |
send out "P" (ascii 80)
send out line number as ASCII character, range=0 through 1
send out the duty cycle as two chars/bytes, high byte first, then low byte, to make a 10-bit number (zero through 1023)
For example: to set the duty cycle to 100% (full on), send out ascii 03 in the high byte, followed by ascii 255 in the low byte. |