ESPectro32 Library
Library for using ESPectro32 board
 All Classes Functions Variables Enumerations Enumerator Pages
Public Member Functions | Private Attributes | List of all members
ESPectro32_Board Class Reference

Public Member Functions

bool begin ()
 Must be called as soon as possible to do initialization stuffs.
 
ESPectro32_RGBLEDRgbLed ()
 Get RGB LED object of the ESPectro32 board. More...
 
ESPectro32_LEDLED ()
 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_ButtonButtonA ()
 Get Button "A" object. More...
 
ESPectro32_ButtonButtonB ()
 Get Button "B" object. More...
 
ESPectro32_LedMatrixLedMatrix ()
 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_RGBLEDrgbLed_ = NULL
 
ESPectro32_LEDled_ = NULL
 
ESPectro32_ButtonbuttonA_ = NULL
 
ESPectro32_ButtonbuttonB_ = NULL
 
ESPectro32_LedMatrixledMatrix_ = NULL
 

Member Function Documentation

void ESPectro32_Board::blinkLED ( uint32_t  interval = 500,
uint32_t  count = UINT16_MAX 
)

blink the built-in LED

Parameters
intervalhow often is the blinking process
counthow 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.

Returns
The Button A object.
ESPectro32_Button object of Button A
See Also
ESPectro32_Button
Examples:
examples-idf/ex_button.hpp, and examples/Button/Button.ino.
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.

Returns
The Button B object.
ESPectro32_Button object of Button B
See Also
ESPectro32_Button
Examples:
examples-idf/ex_button.hpp, and examples/Button/Button.ino.
void ESPectro32_Board::fadeLED ( uint32_t  duration = 1000,
uint32_t  count = UINT16_MAX 
)

fade the built-in LED

Parameters
intervalhow often is the fadeing process
counthow 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.

Returns
The LED object.

get the object of ESPectro32' LED

Returns
ESPeectro32_LED object
See Also
ESPectro32_LED
Examples:
examples-idf/ex_leds_anim.hpp, and examples/Neopixel/Neopixel.ino.
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.

Returns
The Led Matrix object.
Examples:
examples-idf/ex_leds_anim.hpp, examples-idf/ex_wifi_conn_anim.hpp, and examples/LEDMatrix/LEDMatrix.ino.
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.

Parameters
[in]channelADC1 channel to read. Values can be: ADC1_CHANNEL_0 - ADC1_CHANNEL_7
[in]bitWidthHow 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]attenAttenuation level. Values can be: ADC_ATTEN_0db, ADC_ATTEN_2_5db, ADC_ATTEN_6db, ADC_ATTEN_11db
Returns
The analog reading in integer
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.

Parameters
[in]channelADC1 channel to read. Values can be: ADC1_CHANNEL_0 - ADC1_CHANNEL_7
[in]bitWidthHow 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]attenAttenuation level. Values can be: ADC_ATTEN_0db, ADC_ATTEN_2_5db, ADC_ATTEN_6db, ADC_ATTEN_11db
Returns
The analog reading in Volt
ESPectro32_RGBLED & ESPectro32_Board::RgbLed ( )

Get RGB LED object of the ESPectro32 board.

Returns
ESPectro32_RGBLED object
See Also
ESPectro32_RGBLED
Examples:
examples-idf/ex_leds_anim.hpp, and examples/Neopixel/Neopixel.ino.

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