#include "SoulissFramework.h"
// Configure the framework
#include "bconf/MCU_ESP8266.h" // Load the code directly on the ESP8266
#include "conf/IPBroadcast.h"
// **** Define the WiFi name and password ****
#define WIFICONF_INSKETCH
#define WiFi_SSID
#define WiFi_Password
// Include framework code and libraries
#include <ESP8266WiFi.h>
#include "Souliss.h"
//----------------------------------------------------
// 4. Slots
//----------------------------------------------------
#define LedSLOT 1
//----------------------------------------------------
// 5. Pines
//----------------------------------------------------
#define LedPIN 2
const int relay = 2;
const int BOTON = 0;
int val = 0; //val se emplea para almacenar el estado del boton
int state = 1; // 0 LED apagado, mientras que 1 encendido
int old_val = 0; // almacena el antiguo valor de val
void setup()
{
Initialize();
// Connect to the WiFi network and get an address from DHCP
GetIPAddress();
SetAddress(0xAB04, 0xFF00, 0xAB01);
Set_SimpleLight(LedSLOT);
pinMode(LedPIN, OUTPUT);
pinMode(BOTON,INPUT); // y BOTON como señal de entrada
}
void loop()
{
EXECUTEFAST() {
UPDATEFAST();
FAST_50ms() {
DigIn(BOTON, Souliss_T1n_ToggleCmd, LedSLOT);
Logic_SimpleLight(LedSLOT);
DigOut(LedPIN, Souliss_T1n_Coil, LedSLOT);
}
FAST_PeerComms();
START_PeerJoin();
}
EXECUTESLOW() {
UPDATESLOW();
SLOW_PeerJoin();
}
}