Receiver
RC Receiver component plugin for Johnny-Five.
API & Documentation
Receiver
The Receiver
class constructs objects that represent a single RC Receiver component.
var receiver = ; receiver;
Options
Property | Type | Value(s)/Description | Default | Required |
---|---|---|---|---|
address | number | Address for I2C device * | 0x0A |
no |
channels | number | Number of channels | 6 | no |
channels | array | Array of channel names ** | ** | no |
// Example of explicitly specified addressvar receiver = address: 0x04;
* The I2C address defaults to 0x0A
, however digital pins 10 & 11 can be used to configure the address, according to the following table:
D11 | D12 | Address |
---|---|---|
0 | 0 | 0x0A |
0 | 1 | 0x0B |
1 | 0 | 0x0C |
1 | 1 | 0x0D |
** The built-in channel names are derived from the most commonly used names in the most common order:
throttle
aileron
elevator
rudder
gear
aux1
aux2
aux3
When channels: [...]
are specified, the length is used to set the channel count and the names provided are used to override the above listed names.
Properties
Property | Type | Value(s)/Description |
---|---|---|
1-n | number | Each channel value is accessible via numeric channel property. These are NOT zero-indexed |
Iterable/Iterator Protocol
For code running in Node.js 4.2.x or newer, Receiver
objects implement the Iterable Protocol.
var receiver = ; // Create a zero-indexed array of receiver's current values:var array = Array;
Events
-
change Fired whenever any channel value changes.
-
change:[name] Fired whenever the channel matching
[name]
changes.receiver;receiver; -
data Fired as frequently as the hardware can be read.
Backpack Controller
Install Firmware
Using the Arduino IDE, install the firmware to your AVR based microcontroller of choice.
Assembly
Connect To I2C Capable Platform
Arduino UNO
var five = ;var Receiver = five;var board = ; board;
Tessel 2
var five = ;var Receiver = five;var Tessel = ;var board = io: ; board;
Intel Edison MiniBoard
Intel Edison Arduino Board
var five = ;var Receiver = five;var Edison = ;var board = io: ; board;
Flight Simulator
Coming soon?
NOTE
The examples shown here are provided for illustration and do no specifically indicate platform support. This component class is expected to work with any platform that has I2C support.