Esp8266 blog. Learn how to compile, how to work with the wireless chip esp8266. ESP-01 ESP-03, ESP-07, ESP-12, ESP201 all are here
Tuesday, April 26, 2016
Configuring and trigger GPIO on FreeRTOS
On my MQTT broker I wanted to have also a visual view of incoming packets along with monitoring the WiFi connection.
To do that I need to control the RGB led connected on my Witty module.
Controlling the GPIO assume two steps:
1. Configuring the GPIO
#include "gpio.h"
#define LED13_GPIO 13
GPIO_ConfigTypeDef led13;
led13.GPIO_Pin = GPIO_Pin_13;
led13.GPIO_Mode = GPIO_Mode_Output;
led13.GPIO_Pullup = GPIO_PullUp_DIS;
led13.GPIO_IntrType = GPIO_PIN_INTR_DISABLE;
gpio_config(&led13);
2. Triggering the GPIO
GPIO_OUTPUT_SET(LED13_GPIO,1);
vTaskDelay(100 / portTICK_RATE_MS);
GPIO_OUTPUT_SET(LED13_GPIO,0);
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment