(mentions of serialio are interchangeable with monomeserial)
button, led, adc addressing
all buttons, leds, and adcs are addressed starting at 0 rather than 1. rows will be mapped to the integers 0 – 7 rather than 1 – 8. Likewise, adcs will be mapped to the integers 0 – 3 rather than 1 – 4.
output (messages sent by 40h)
button press event
serialio sends an osc packet containing this message to the broadcast address when a button is depressed or released.
address pattern: /box/press
parameters:
x – int, button x coordinate
y – int, button y coordinate
state – int [0 | 1] button state
examples:
button down event - /box/press 3 4 1
button up event - /box/press 3 4 0
adc value change event
serialio sends an osc packet containing this message when the value read by an enabled adc differs from the previous value.
address pattern: /box/adc
parameters: adc – int [0 - 3]
value – float [0.0 – 1.0]
examples:
current adc state - /box/adc 0 .54321
input (messages understood by serialio)
set single led state
sending an osc packet containing this message to the port on which serialio is listening sets the state (on or off) of the led beneath the specified button.
address pattern: /box/led
parameters: x – int, button x coordinate
y – int, button y coordinate
state – int [0 | 1], led state
examples:
led on - /box/led 0 4 1
led off - /box/led 0 4 0
set state of entire row of leds
sending an osc packet containing this message to the port on which serialio is listening sets the state (on or off) of all leds in the specified row. the state is specified as an 8-bit map where a set bit represents an led which should be turned on and a cleared bit represents an led which should be turned off.
address pattern: /box/led_row
parameters: row – int, row number
state: int [0 – 255], state of leds as 8-bit bitmap
examples:
turn on all leds in first row - /box/led_row 0 255
turn off all leds in first row - /box/led_row 0 0
set state of entire column of leds
sending an osc packet containing this message to the port on which serialio is listening sets the state (on or off) of all leds in the specified column. the state is specified as an 8-bit map where a set bit represents an led whichshould be turned on and a cleared bit represents an led which should beturned off.
address pattern: /box/led_col
parameters: col – int, column number
examples:
turn on all leds in second column - /box/led_col 1 255
turn off all leds in second column - /box/led_col 1 0
set led intensity
sending an osc packet containing this message to the port on which serialio is listening sets the brightness of the leds.
address pattern: /box/intensity
parameters: intensity, float [0.0 – 1.0]
examples:
set the intensity of the 40h to 50% - /box/intensity 0.5
test leds (turns on all leds)
sending an osc packet containing this message to the port on which serialio is listening sets 40h in a test state where all leds are turned on or returns 40h to normal operation.
address pattern: /box/test
parameters: state, int [0 | 1]
examples:
turn led test on - /box/test 1
turn led test off - /box/test 0
enable adc
sending an osc packet containing this message to the port on which serialio is listening enables or disables the specified adc causing serialio to begin to stop reporting adc value change messages.
address pattern: /box/adc_enable
parameters: adc, int [0 – 4]
enabled, int [0 | 1]
examples:
enable adc 0 - /box/adc_enable 0 1
disable adc 0 - /box/adc_enable 0 0
set box in lower power mode
sending an osc packet containing this message to the port on which serialio is listening sets 40h in a lowpower shutdown state or returns 40h to normal operation.
address pattern: /box/shutdown
parameters: state [1 | 0], enable/disable lower power mode
examples:
turn on lower power mode - /box/shutdown 1
turn off lower power mode - /box/shutdown 0
encoder messages
send to serialio:
enable encoder 0 - /box/enc_enable 0 1
disable encoder 0 - /box/enc_enable 0 0
received from serialio:
encoder 0 position change: /box/enc 0 -20
encoder positions are relative from frame to frame. counter-clockwise gives positive steps (positive degrees) while clockwise gives negative steps.