EVShield  v1.3
EVShield Library Reference by mindsensors.com
EVShield Class Reference

This class defines methods to access EVShield features. More...

#include <EVShield.h>

Public Member Functions

 EVShield (uint8_t i2c_address_a=SH_Bank_A, uint8_t i2c_address_b=SH_Bank_B)
 
void init (SH_Protocols protocol=SH_HardwareI2C)
 
void initLEDTimers ()
 
void I2CTimer ()
 
void initProtocols (SH_Protocols protocol=SH_HardwareI2C)
 
bool getButtonState (uint8_t btn)
 
void waitForButtonPress (uint8_t btn, uint8_t led_pattern=1)
 
void ledSetRGB (uint8_t red=0, uint8_t green=0, uint8_t blue=0)
 
void ledBreathingPattern ()
 
void ledHeartBeatPattern ()
 
void getTouchscreenValues (uint16_t *x, uint16_t *y)
 
uint16_t TS_X ()
 
uint16_t TS_Y ()
 
bool isTouched ()
 
bool checkButton (uint16_t x, uint16_t y, uint16_t width, uint16_t height)
 
uint8_t getFunctionButton ()
 

Public Attributes

uint8_t m_protocol
 
EVShieldBank bank_a
 
EVShieldBankB bank_b
 

Detailed Description

This class defines methods to access EVShield features.

Constructor & Destructor Documentation

§ EVShield()

EVShield::EVShield ( uint8_t  i2c_address_a = SH_Bank_A,
uint8_t  i2c_address_b = SH_Bank_B 
)

class constructor for EVShield; optional custom i2c addresses may be supplied for both banks

Member Function Documentation

§ checkButton()

bool EVShield::checkButton ( uint16_t  x,
uint16_t  y,
uint16_t  width,
uint16_t  height 
)

Wi-Fi Arduino Interface for PiStorms only!
returns true if the specified area of the screen is being touched

§ getButtonState()

bool EVShield::getButtonState ( uint8_t  btn)

Get the button state of the specific button on EVShield.
When using the Wi-Fi Arduino Interface for PiStorms, there is only a GO button. The PiStorms does not have a left or right button like the EVShield. In this case, the F1 software button will be BTN_LEFT, and F2 will be BTN_RIGHT. If a program asks you to press the left button, instead tap the stylus in the F1 area on screen.

Parameters
btnButton to get state for (BTN_GO, BTN_LEFT, BTN_RIGHT)
Returns
true or false for specified button on the EVShield

§ getFunctionButton()

uint8_t EVShield::getFunctionButton ( )

Wi-Fi Arduino Interface for PiStorms only!
returns 0 if none of the software buttons are touched, or 1-4 if one of them is.

§ getTouchscreenValues()

void EVShield::getTouchscreenValues ( uint16_t *  x,
uint16_t *  y 
)

Wi-Fi Arduino Interface for PiStorms only!
Read the touchscreen press and write the coordinates to the output parameters.

Parameters
xx-value of touchscreen press is written to this variable
yy-value of touchscreen press is written to this variable

§ I2CTimer()

void EVShield::I2CTimer ( )

the initialization of the EVShield I2C timer.

§ init()

void EVShield::init ( SH_Protocols  protocol = SH_HardwareI2C)

the initialization of the EVShield; This function initializes the LED related timers, and communication protocols.

Parameters
protocoloptional, specify the i2c protocol to use for the EVShield and highspeed i2c port

§ initLEDTimers()

void EVShield::initLEDTimers ( )

the initialization of the EVShield LED timers.

§ initProtocols()

void EVShield::initProtocols ( SH_Protocols  protocol = SH_HardwareI2C)

the initialization of EVShield communication protocols.

Parameters
protocoloptional, specify the i2c protocol to use for the EVShield and highspeed i2c port

§ isTouched()

bool EVShield::isTouched ( )

Wi-Fi Arduino Interface for PiStorms only!
Detect touchscreen presses and prevents false positives.

§ ledBreathingPattern()

void EVShield::ledBreathingPattern ( )

The LED is brightened and dimmed in a breathing pattern. Call this function repeatedly to make the pattern.

§ ledHeartBeatPattern()

void EVShield::ledHeartBeatPattern ( )

The LED is brightened and dimmed in a HeartBeat pattern. Call this function repeatedly to make the pattern.

§ ledSetRGB()

void EVShield::ledSetRGB ( uint8_t  red = 0,
uint8_t  green = 0,
uint8_t  blue = 0 
)

Set the colors of LED on the EVShield; The values of red, green, blue are between 0 to 255.

Parameters
redIntensity for red color (between 0 and 255)
greenIntensity for green color (between 0 and 255)
blueIntensity for blue color (between 0 and 255)

§ TS_X()

uint16_t EVShield::TS_X ( )

Wi-Fi Arduino Interface for PiStorms only!
Reads the x-coordinate of the touchscreen press

§ TS_Y()

uint16_t EVShield::TS_Y ( )

Wi-Fi Arduino Interface for PiStorms only!
Reads the y-coordinate of the touchscreen press

§ waitForButtonPress()

void EVShield::waitForButtonPress ( uint8_t  btn,
uint8_t  led_pattern = 1 
)

Wait inside function until specified button is pressed on EVShield (BTN_GO, BTN_LEFT, BTN_RIGHT)

Parameters
btnButton to get state for (BTN_GO, BTN_LEFT, BTN_RIGHT)
led_pattern0 for LED off. 1 to brighten/lighten LED with breathing pattern (default). 2 to brighten/lighten LED with heart beat pattern.

Member Data Documentation

§ bank_a

EVShieldBank EVShield::bank_a

Variable for the bank_a of EVShield

§ bank_b

EVShieldBankB EVShield::bank_b

Variable for the bank_b of EVShield

§ m_protocol

uint8_t EVShield::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: