Code:
PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDI_U, FUNC_GPIO12); // Use MTDI pin as GPIO12.
Statistics: Posted by Guest — Sun Nov 27, 2016 1:51 pm
Code:
#include <osapi.h>
#include <ets_sys.h>
#include <gpio.h>
#include "user_interface.h"
#include "eagle_soc.h"
os_timer_t timer;
void toggleGPIO(void){
if (GPIO_REG_READ(GPIO_OUT_ADDRESS) & BIT10)
{
gpio_output_set(0, BIT10, BIT10, 0);
os_printf("SET BIT10 to low.\n");
}
else
{
gpio_output_set(BIT10, 0, BIT10, 0);
os_printf("SET BIT10 to high.\n");
}
}
void user_init(void){
os_timer_setfn(&timer,(os_timer_func_t*)toggleGPIO,NULL);
os_timer_arm(&timer,1000,1);
}
Statistics: Posted by Stational — Sun Nov 20, 2016 5:49 am