ESPectro32 Library
Library for using ESPectro32 board
|
Public Member Functions | |
bool | begin () |
Must be called as soon as possible to do initialization stuffs. | |
ESPectro32_RGBLED & | RgbLed () |
Get RGB LED object of the ESPectro32 board. More... | |
ESPectro32_LED & | LED () |
Get LED object. More... | |
void | turnOnLED () |
Turn on built-in LED. | |
void | turnOffLED () |
Turn off built-in LED. | |
void | blinkLED (uint32_t interval=500, uint32_t count=UINT16_MAX) |
blink the built-in LED More... | |
void | fadeLED (uint32_t duration=1000, uint32_t count=UINT16_MAX) |
fade the built-in LED More... | |
void | stopLEDAnimation () |
stop the current LED animation | |
void | toggleLED () |
Toggle the current state of the LED. | |
ESPectro32_Button & | ButtonA () |
Get Button "A" object. More... | |
ESPectro32_Button & | ButtonB () |
Get Button "B" object. More... | |
ESPectro32_LedMatrix & | LedMatrix () |
Get Led Matrix object. More... | |
int | readAnalog (adc1_channel_t channel, adc_bits_width_t bitWidth=ADC_WIDTH_12Bit, adc_atten_t atten=ADC_ATTEN_6db) |
Conveniently read analog data. More... | |
float | readAnalogVoltage (adc1_channel_t channel, adc_bits_width_t bitWidth=ADC_WIDTH_12Bit, adc_atten_t atten=ADC_ATTEN_6db) |
Conveniently read analog data converted to its voltage value. More... | |
int | readPhotoTransistorValue (adc_bits_width_t bitWidth=ADC_WIDTH_12Bit, adc_atten_t atten=ADC_ATTEN_6db) |
float | readPhotoTransistorVoltage (adc_bits_width_t bitWidth=ADC_WIDTH_12Bit, adc_atten_t atten=ADC_ATTEN_6db) |
int | readOnBoardHallSensor () |
void | scanI2C () |
Scan attached I2C peripherals. | |
Private Attributes | |
ESPectro32_RGBLED * | rgbLed_ = NULL |
ESPectro32_LED * | led_ = NULL |
ESPectro32_Button * | buttonA_ = NULL |
ESPectro32_Button * | buttonB_ = NULL |
ESPectro32_LedMatrix * | ledMatrix_ = NULL |
void ESPectro32_Board::blinkLED | ( | uint32_t | interval = 500 , |
uint32_t | count = UINT16_MAX |
||
) |
blink the built-in LED
interval | how often is the blinking process |
count | how many times to blink |
ESPectro32_Button & ESPectro32_Board::ButtonA | ( | ) |
Get Button "A" object.
Get ESPectro32 Button A object.
This method is for getting Button "A" object so that you can attach event handlers in order to detect click, double click, and long press. Button A is connected to GPIO 0.
ESPectro32_Button & ESPectro32_Board::ButtonB | ( | ) |
Get Button "B" object.
Get ESPectro32 Button B object.
This method is for getting Button "B" object so that you can attach event handlers in order to detect click, double click, and long press. Button A is connected to GPIO 4.
void ESPectro32_Board::fadeLED | ( | uint32_t | duration = 1000 , |
uint32_t | count = UINT16_MAX |
||
) |
fade the built-in LED
interval | how often is the fadeing process |
count | how many times to fade |
ESPectro32_LED & ESPectro32_Board::LED | ( | ) |
Get LED object.
This method is for getting LED object so that you can work with it, either turn it on/off, blink it, toggle it, or fade it in/out.
get the object of ESPectro32' LED
ESPectro32_LedMatrix & ESPectro32_Board::LedMatrix | ( | ) |
Get Led Matrix object.
This method is for getting Led Matrix object so that you can start working with it. You can use it to display shapes, icons, text, or pixel-by-pixel manipulation.
int ESPectro32_Board::readAnalog | ( | adc1_channel_t | channel, |
adc_bits_width_t | bitWidth = ADC_WIDTH_12Bit , |
||
adc_atten_t | atten = ADC_ATTEN_6db |
||
) |
Conveniently read analog data.
[in] | channel | ADC1 channel to read. Values can be: ADC1_CHANNEL_0 - ADC1_CHANNEL_7 |
[in] | bitWidth | How wide the bit to capture. Values can be: ADC_WIDTH_9Bit (511 max), ADC_WIDTH_10Bit (1023 max), ADC_WIDTH_11Bit (2047 max), ADC_WIDTH_12Bit (4095 max) |
[in] | atten | Attenuation level. Values can be: ADC_ATTEN_0db, ADC_ATTEN_2_5db, ADC_ATTEN_6db, ADC_ATTEN_11db |
float ESPectro32_Board::readAnalogVoltage | ( | adc1_channel_t | channel, |
adc_bits_width_t | bitWidth = ADC_WIDTH_12Bit , |
||
adc_atten_t | atten = ADC_ATTEN_6db |
||
) |
Conveniently read analog data converted to its voltage value.
[in] | channel | ADC1 channel to read. Values can be: ADC1_CHANNEL_0 - ADC1_CHANNEL_7 |
[in] | bitWidth | How wide the bit to capture. Values can be: ADC_WIDTH_9Bit (511 max), ADC_WIDTH_10Bit (1023 max), ADC_WIDTH_11Bit (2047 max), ADC_WIDTH_12Bit (4095 max) |
[in] | atten | Attenuation level. Values can be: ADC_ATTEN_0db, ADC_ATTEN_2_5db, ADC_ATTEN_6db, ADC_ATTEN_11db |
ESPectro32_RGBLED & ESPectro32_Board::RgbLed | ( | ) |
Get RGB LED object of the ESPectro32 board.