Nintendo R.O.B. Control Library  v1.1.2
Library to control the Nintendo Robotic Operating Buddy
Public Types | Public Member Functions | List of all members
NesRob Class Reference

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...
 

Detailed Description

Nintendo R.O.B. Control Library.

The library defines and generates all known R.O.B. commands.

Member Enumeration Documentation

◆ Command

enum NesRob::Command : uint8_t
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 
Deprecated:
Use RECALIBRATE instead.
ARMS_LEFT 
Deprecated:
Use LEFT instead.
ARMS_RIGHT 
Deprecated:
Use RIGHT instead.
ARMS_LOWER 
Deprecated:
Use DOWN instead.
ARMS_LOWER_2 
Deprecated:
Use DOWN_2 instead.
ARMS_RAISE 
Deprecated:
Use UP instead.
ARMS_RAISE_2 
Deprecated:
Use UP_2 instead.
HANDS_CLOSE 
Deprecated:
Use CLOSE instead.
HANDS_OPEN 
Deprecated:
Use OPEN instead.
TEST_LED 
Deprecated:
Use LED_ENABLE instead.

◆ CommandTarget

enum NesRob::CommandTarget
strong

Valid targets for commands.

Note
The 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.
See also
NesRob::Command
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.

◆ ErrorCode

enum NesRob::ErrorCode : int
strong

Error codes.

Enumerator
SUCCESS 

No errors encountered during execution.

E_SIGGEN 

An unspecified error occured during signal generation.

Constructor & Destructor Documentation

◆ NesRob()

NesRob::NesRob ( unsigned int  pin,
CommandTarget  target = CommandTarget::PHOTOSENSOR 
)

Allocate required resources.

Parameters
[in]pinThe digital GPIO used to send commands
[in]targetThe target of the commands Default: NesRob::CommandTarget::PHOTOSENSOR
See also
NesRob::CommandTarget

◆ ~NesRob()

NesRob::~NesRob ( void  )

Destroy allocated resources.

Member Function Documentation

◆ blinkCommand()

void NesRob::blinkCommand ( Command  command) const

◆ sendCommand()

int NesRob::sendCommand ( Command  command) const

Send command to R.O.B.

Parameters
[in]commandThe command you wish R.O.B. to perform
Returns
int An error code describing errors encountered during processing
Return values
NesRob::SUCCESSNo errors encountered during processing.
NesRob::E_SIGGENAn unspecified error occured during signal generation.
See also
NesRob::Command

The documentation for this class was generated from the following files: