|
Nintendo R.O.B. Control Library
v1.1.2
Library to control the Nintendo Robotic Operating Buddy
|
Nintendo R.O.B. Control Library. More...
#include <NesRob.h>
Public Types | |
| enum class | Command : uint8_t { LEFT = 0xBA , RIGHT = 0xEA , DOWN = 0xAE , DOWN_2 = 0xFB , UP = 0xFA , UP_2 = 0xBB , CLOSE = 0xBE , OPEN = 0xEE , LED_DISABLE = 0xAA , LED_ENABLE = 0xEB , RECALIBRATE = 0xAB , CALIBRATE_MOTORS = 0xAB , ARMS_LEFT = 0xBA , ARMS_RIGHT = 0xEA , ARMS_LOWER = 0xAE , ARMS_LOWER_2 = 0xFB , ARMS_RAISE = 0xFA , ARMS_RAISE_2 = 0xBB , HANDS_CLOSE = 0xBE , HANDS_OPEN = 0xEE , TEST_LED = 0xEB } |
| Available R.O.B. Commands. More... | |
| enum class | CommandTarget { PHOTOSENSOR , MAIN_CPU } |
| Valid targets for commands. More... | |
| enum class | ErrorCode : int { SUCCESS = 0 , E_SIGGEN } |
| Error codes. More... | |
Public Member Functions | |
| NesRob (unsigned int pin, CommandTarget target=CommandTarget::PHOTOSENSOR) | |
| Allocate required resources. More... | |
| ~NesRob (void) | |
| Destroy allocated resources. More... | |
| void | blinkCommand (Command command) const |
| Blink command to R.O.B. More... | |
| int | sendCommand (Command command) const |
| Send command to R.O.B. More... | |
Nintendo R.O.B. Control Library.
The library defines and generates all known R.O.B. commands.
|
strong |
Available R.O.B. Commands.
| Enumerator | |
|---|---|
| LEFT | Rotate R.O.B.'s torso left one station. |
| RIGHT | Rotate R.O.B.'s torso right one station. |
| DOWN | Lower R.O.B.'s shoulders one notch. |
| DOWN_2 | Lower R.O.B.'s shoulders two notches. |
| UP | Raise R.O.B.'s shoulders one notch. |
| UP_2 | Raise R.O.B.'s shoulders two notches. |
| CLOSE | Close R.O.B.'s arms. |
| OPEN | Open R.O.B.'s arms. |
| LED_DISABLE | Disable R.O.B.'s LED. |
| LED_ENABLE | Enable R.O.B.'s LED. |
| RECALIBRATE | Reruns the start-up calibration routine. |
| CALIBRATE_MOTORS |
|
| ARMS_LEFT |
|
| ARMS_RIGHT |
|
| ARMS_LOWER |
|
| ARMS_LOWER_2 |
|
| ARMS_RAISE |
|
| ARMS_RAISE_2 |
|
| HANDS_CLOSE |
|
| HANDS_OPEN |
|
| TEST_LED |
|
|
strong |
Valid targets for commands.
MAIN_CPU target requires hardware modification to utilize. The signal should be injected inline with the ribbon cable, running down R.O.B.'s neck from his head to the base.| Enumerator | |
|---|---|
| PHOTOSENSOR | Generates NTSC signal for the optical sensor in the left eye. |
| MAIN_CPU | Generates the W square wave for the main CPU on R.O.B.'s motherboard. |
|
strong |
| NesRob::NesRob | ( | unsigned int | pin, |
| CommandTarget | target = CommandTarget::PHOTOSENSOR |
||
| ) |
Allocate required resources.
| [in] | pin | The digital GPIO used to send commands |
| [in] | target | The target of the commands Default: NesRob::CommandTarget::PHOTOSENSOR |
| NesRob::~NesRob | ( | void | ) |
Destroy allocated resources.
| void NesRob::blinkCommand | ( | Command | command | ) | const |
Blink command to R.O.B.
| [in] | command | The command you wish R.O.B. to perform |
| int NesRob::sendCommand | ( | Command | command | ) | const |
Send command to R.O.B.
| [in] | command | The command you wish R.O.B. to perform |
int An error code describing errors encountered during processing | NesRob::SUCCESS | No errors encountered during processing. |
| NesRob::E_SIGGEN | An unspecified error occured during signal generation. |