Thanks you,
I am not able to make programs
I have no ideas how to collect logic sketch of T14
Typical 14 : Pulse Digital Output.
I look for opportunities to make it in a network.
so far I have made only it:
it turns off sockets and the light my home through a mobile network and wi-fi :)
I use "ESP8266 NodeMcu V2 Lua WIFI"
/**************************************************************************
Souliss - Hello World for Expressif ESP8266
This is the basic example, create a software push-button on Android
using SoulissApp (get it from Play Store).
Load this code on ESP8266 board using the porting of the Arduino core
for this platform.
***************************************************************************/
// Let the IDE point to the Souliss framework
#include "SoulissFramework.h"
// Configure the framework
#include "bconf/MCU_ESP8266.h" // Load the code directly on the ESP8266
#include "conf/Gateway.h" // The main node is the Gateway, we have just one node
#include "conf/IPBroadcast.h"
// **** Define the WiFi name and password ****
#define WIFICONF_INSKETCH
#define WiFi_SSID "Wlan SSID"
#define WiFi_Password "WiFi_Password"
// Include framework code and libraries
#include <ESP8266WiFi.h>
#include <EEPROM.h>
/*** All configuration includes should be above this line ***/
#include "Souliss.h"
// This identify the number of the LED logic
#define MYLEDLOGIC 1
#define MYLEDLOGIC2 2
#define MYLEDLOGIC3 3
#define MYLEDLOGIC4 4
#define MYLEDLOGIC5 5
#define MYLEDLOGIC6 6
#define MYLEDLOGIC7 7
#define MYLEDLOGIC8 8
// **** Define here the right pin for your ESP module ****
#define OUTPUTPIN 0
#define OUTPUTPIN2 5
#define OUTPUTPIN3 4
#define OUTPUTPIN4 16
#define OUTPUTPIN5 2
#define OUTPUTPIN6 14
#define OUTPUTPIN7 13
#define OUTPUTPIN8 3
void setup()
{
Initialize();
// Connect to the WiFi network and get an address from DHCP
GetIPAddress();
SetAsGateway(myvNet_dhcp); // Set this node as gateway for SoulissApp
// This is the vNet address for this node, used to communicate with other
// nodes in your Souliss network
SetAddress(0xAB01, 0xFF00, 0x0000);
Set_SimpleLight(MYLEDLOGIC); // Define a simple LED light logic
Set_SimpleLight(MYLEDLOGIC2);
Set_SimpleLight(MYLEDLOGIC3);
Set_SimpleLight(MYLEDLOGIC4); // Define a simple LED light logic
Set_SimpleLight(MYLEDLOGIC5);
Set_SimpleLight(MYLEDLOGIC6);
Set_SimpleLight(MYLEDLOGIC7); // Define a simple LED light logic
Set_SimpleLight(MYLEDLOGIC8);
pinMode(OUTPUTPIN, OUTPUT); // Use pin as output #
pinMode(OUTPUTPIN2, OUTPUT);
pinMode(OUTPUTPIN3, OUTPUT);
pinMode(OUTPUTPIN4, OUTPUT); // Use pin as output #
pinMode(OUTPUTPIN5, OUTPUT);
pinMode(OUTPUTPIN6, OUTPUT);
pinMode(OUTPUTPIN7, OUTPUT); // Use pin as output #
pinMode(OUTPUTPIN8, OUTPUT);
}
void loop()
{
// Here we start to play
EXECUTEFAST() {
UPDATEFAST();
FAST_50ms() { // We process the logic and relevant input and output every 50 milliseconds
Logic_SimpleLight(MYLEDLOGIC);
LowDigOut(OUTPUTPIN, Souliss_T1n_Coil,MYLEDLOGIC);
// Here we handle here the communication with Android
FAST_GatewayComms();
}
}
{
// Here we start to play
EXECUTEFAST() {
UPDATEFAST();
FAST_10ms() { // We process the logic and relevant input and output every 50 milliseconds
Logic_SimpleLight(MYLEDLOGIC2);
LowDigOut(OUTPUTPIN2, Souliss_T1n_Coil,MYLEDLOGIC2);
}
// Here we handle here the communication with Android
FAST_GatewayComms();
}
}
{
// Here we start to play
EXECUTEFAST() {
UPDATEFAST();
FAST_50ms() { // We process the logic and relevant input and output every 50 milliseconds
Logic_SimpleLight(MYLEDLOGIC3);
LowDigOut(OUTPUTPIN3, Souliss_T1n_Coil,MYLEDLOGIC3);
}
// Here we handle here the communication with Android
FAST_GatewayComms();
}
}
{
// Here we start to play
EXECUTEFAST() {
UPDATEFAST();
FAST_50ms() { // We process the logic and relevant input and output every 50 milliseconds
Logic_SimpleLight(MYLEDLOGIC4);
LowDigOut(OUTPUTPIN4, Souliss_T1n_Coil,MYLEDLOGIC4);
}
// Here we handle here the communication with Android
FAST_GatewayComms();
}
}
{
// Here we start to play
EXECUTEFAST() {
UPDATEFAST();
FAST_50ms() { // We process the logic and relevant input and output every 50 milliseconds
Logic_SimpleLight(MYLEDLOGIC5);
LowDigOut(OUTPUTPIN5, Souliss_T1n_Coil,MYLEDLOGIC5);
}
// Here we handle here the communication with Android
FAST_GatewayComms();
}
}
{
// Here we start to play
EXECUTEFAST() {
UPDATEFAST();
FAST_50ms() { // We process the logic and relevant input and output every 50 milliseconds
Logic_SimpleLight(MYLEDLOGIC6);
LowDigOut(OUTPUTPIN6, Souliss_T1n_Coil,MYLEDLOGIC6);
}
}
// Here we start to play
EXECUTEFAST() {
UPDATEFAST();
FAST_50ms() { // We process the logic and relevant input and output every 50 milliseconds
Logic_SimpleLight(MYLEDLOGIC7);
LowDigOut(OUTPUTPIN7, Souliss_T1n_Coil,MYLEDLOGIC7);
}
// Here we handle here the communication with Android
FAST_GatewayComms();
{
}
{
{
{
}
// Here we start to play
EXECUTEFAST() {
UPDATEFAST();
FAST_50ms() { // We process the logic and relevant input and output every 50 milliseconds
Logic_SimpleLight(MYLEDLOGIC8);
LowDigOut(OUTPUTPIN8, Souliss_T1n_Coil,MYLEDLOGIC8);
}
// Here we handle here the communication with Android
FAST_GatewayComms();
{
}
}
}
}
}
}
}
пятница, 13 мая 2016 г., 19:10:09 UTC+2 пользователь Antonino Fazio написал: