WiFi ESP Click Board
WiFi ESP Click Board
The WiFi ESP Click Board™ carries the ESP-WROOM-02 module that is based on the ESP8266EX.
The WiFi ESP Click Board™ is designed to run on a 3.3V power supply. It communicates with the target microcontroller over UART interface and the following MikroBUS signals: RST, CS.
Software Support
Code examples for the , written for MikroElektronika hardware and compilers are available on Libstock.
CODE SNIPPET
This code snippet configures GPIO ports, initializes the display and prepares the WiFi module. In an endless loop, LED is enabled or disabled by a button, and that information is then sent to the server.
01 void main() { 02 03 // Initialize variables 04 length = 0; 05 state = 0; 06 response_rcvd = 0; 07 responseID = 0; 08 response = 0; 09 i = 0; 10 11 // GPIO Direction 12 GPIO_Digital_Input( &GPIOA_IDR, _GPIO_PINMASK_4 ); 13 GPIO_Digital_Output( &GPIOD_BASE, _GPIO_PINMASK_13 ); 14 GPIO_Digital_Output( &GPIOC_BASE, _GPIO_PINMASK_2 ); 15 GPIO_Digital_Output( &GPIOA_ODR, _GPIO_PINMASK_0 ); 16 17 // UART Initialization 18 UART3_Init_Advanced( 115200, _UART_8_BIT_DATA, 19 _UART_NOPARITY, 20 _UART_ONE_STOPBIT, 21 &_GPIO_MODULE_USART3_PD89); 22 23 // Enable Interrupts 24 RXNEIE_USART3_CR1_bit = 1; 25 NVIC_IntEnable( IVT_INT_USART3 ); 26 EnableInterrupts(); 27 28 display_init(); 29 30 // Initialize WiFI module 31 WiFi_Init(); 32 33 // Setting WiFi Mode - SoftAP + station mode 34 WiFI_Configure(); 35 36 state = 100; 37 i = 0; 38 39 TFT_Write_Text("Please connect to your STAIP...", 50, 100); 40 Delay_ms(20000); 41 WiFi3_Send(); 42 TFT_Write_Text("Entering button toggling loop.", 50, 150); 43 44 LED_switching = 1; 45 46 while( 1 ) 47 { 48 // detect logical one on PA4 pin 49 if (Button(&GPIOA_IDR, 4, 1, 1)) 50 { 51 oldstate_A4 = 1; 52 } 53 // detect logical one-to-zero transition on PA4 pin 54 if (oldstate_A4 && Button(&GPIOA_IDR, 4, 1, 0)) 55 { 56 if ( !strcmp(txt_state_A0, "OFF</p>" )) 57 { 58 strncpy( txt_state_A0, "ON </p>", 8 ); 59 GPIOA_ODR.B0 = 1; 60 } 61 else 62 { 63 strncpy( txt_state_A0, "OFF</p>", 8 ); 64 GPIOA_ODR.B0 = 0; 65 } 66 oldstate_A4 = 0; 67 A0_change = true; 68 WiFi3_Send(); 69 } 70 } 71 }
WiFi ESP Click Board
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.