This class defines methods to access NXShield features.
More...
#include <NXShield.h>
This class defines methods to access NXShield features.
NXShield::NXShield |
( |
uint8_t |
i2c_address_a = SH_Bank_A , |
|
|
uint8_t |
i2c_address_b = SH_Bank_B |
|
) |
| |
class constructor for NXShield; optional custom i2c addresses may be supplied for both banks
bool NXShield::getButtonState |
( |
uint8_t |
btn | ) |
|
Get the button state of the specific button on NXShield.
- Parameters
-
btn | Button to get state for (BTN_GO, BTN_LEFT, BTN_RIGHT) |
- Returns
- true or false for specified button on the NXShield
the initialization of the NXShield; This function initializes the LED related timers, and communication protocols.
- Parameters
-
protocol | optional, specify the i2c protocol to use for the NXShield and highspeed i2c port |
void NXShield::initLEDTimers |
( |
| ) |
|
the initialization of the NXShield LED timers.
the initialization of NXShield communication protocols.
- Parameters
-
protocol | optional, specify the i2c protocol to use for the NXShield and highspeed i2c port |
void NXShield::ledBreathingPattern |
( |
| ) |
|
The LED is brightened and dimmed in a breathing pattern. Call this function repeatedly to make the pattern.
void NXShield::ledHeartBeatPattern |
( |
| ) |
|
The LED is brightened and dimmed in a HeartBeat pattern. Call this function repeatedly to make the pattern.
void NXShield::ledSetRGB |
( |
uint8_t |
red = 0 , |
|
|
uint8_t |
green = 0 , |
|
|
uint8_t |
blue = 0 |
|
) |
| |
Set the colors of LED on the NXShield; The values of red, green, blue are between 0 to 8 (for 8 intensity levels).
- Parameters
-
red | Intensity for red color (between 0 and 8) |
green | Intensity for green color (between 0 and 8) |
blue | Intensity for blue color (between 0 and 8) |
void NXShield::waitForButtonPress |
( |
uint8_t |
btn, |
|
|
uint8_t |
led_pattern = 1 |
|
) |
| |
Wait inside function until specified button is pressed on NXShield (BTN_GO, BTN_LEFT, BTN_RIGHT)
- Parameters
-
btn | Button to get state for (BTN_GO, BTN_LEFT, BTN_RIGHT) |
led_pattern | 0 for LED off. 1 to brighten/lighten LED with breathing pattern (default). 2 to brighten/lighten LED with heart beat pattern. |
uint8_t NXShield::m_protocol |
Global variable representing the i2c protocol to use; whether software or hardware
The documentation for this class was generated from the following files: