Hardware Reference
In-Depth Information
To receive SysEx data, you must i rst create a SysEx callback, as explained in
the “Callbacks” section.
An example callback might look like this:
void sysexCallback(byte command, byte argc, byte *argv)
{
// Code goes here
}
The SysEx instruction identii er is sent as a byte, called command . The Arduino
Firmata library dei nes a series of constants to describe a received message; as
listed in Table 16-2.
Table 16-2: SysEx Constants
CONSTANT
FUNCTION
RESERVED_COMMAND
Reserved chip-specifi c instructions.
ANALOG_MAPPING_
QUERY
Ask for analog to pin number mapping.
ANALOG_MAPPING_
RESPONSE
Reply with mapping data.
CAPABILITY_QUERY
Ask for supported modes of all pins.
CAPABILITY_RESPONSE
Reply with capability data.
PIN_STATE_QUERY
Ask for a pin's current mode and value.
PIN_STATE_RESPONSE
Reply with pin mode and value.
EXTENDED_ANALOG
Analog write to any pin, including PWM and servo.
SERVO_CONFIG
Set servo parameters (angle, pulse, and such).
STRING_DATA
Send a string message.
SHIFT_DATA
34-bit shift out data.
I2C_REQUEST
Request I 2 C data.
I2C_REPLY
Respond with I 2 C data.
I2C_CONFIG
I 2 C parameters.
REPORT_FIRMWARE
Report version number of Firmata fi rmware.
SAMPLING_INTERVAL
Set sampling interval.
SYSEX_NON_REALTIME
MIDI reserved.
SYSEX_REALTIME
MIDI reserved.
These constants are kept up to date at the Firmata website at http://firmata
.org/wiki/V2.2ProtocolDetails .
Search WWH ::




Custom Search