Home › Forums › EasyTransfer Library Support Forum › Problem with TX
Tagged: arduino, easytransfer
- This topic has 1 reply, 1 voice, and was last updated 8 years, 10 months ago by Anonymous.
-
AuthorPosts
-
October 29, 2015 at 12:44 pm #3378AnonymousInactive
Hi
Well, first explain my proyect: I need to acquire 25 digital signals and pass the signals to my RX and then show it in the serial monitor or more especific in Excel, but in the moment that show me this in Excel “Serial.println(“DATA, DATE, TIME, 550, PARO”);” begin to cyclized and i just need show it when the <span style=”line-height: 1.5;”>acquire detected.</span>
THIS is my code of TX:
#include <EasyTransfer.h>
//create object
EasyTransfer ET;
struct SEND_DATA_STRUCTURE{
//put your variable definitions here for the data you want to send
//THIS MUST BE EXACTLY THE SAME ON THE OTHER ARDUINO
int counter2=0;
// estados de las entradas actuales
int state1 = 0; //400
int state2 = 0; //410
int state3 = 0; //420
int state4 = 0; //430
int state5 = 0; //440
int state6 = 0; //450
int state7 = 0; //460
int state8 = 0; //470
int state9 = 0; //480
int state10 = 0; //490
int state11 = 0; //500
int state12 = 0; //510
int state13 = 0; //520
int state14 = 0; //530
int state15 = 0; //540
int state16; //550
int state17 = 0; //560
int state18 = 0; //570
int state19 = 0; //580
int state20 = 0; //590
int state21 = 0; //600
int state22 = 0; //610
int state23 = 0; //620
int state24 = 0; //630
int state25 = 0; //640
int prev_state1 = 0; // estado previo de las entradas
int prev_state2 = 0;
int prev_state3 = 0;
int prev_state4 = 0;
int prev_state5 = 0;
int prev_state6 = 0;
int prev_state7 = 0;
int prev_state8 = 0;
int prev_state9 = 0;
int prev_state10 = 0;
int prev_state11 = 0;
int prev_state12 = 0;
int prev_state13 = 0;
int prev_state14 = 0;
int prev_state15 = 0;
int prev_state16 = 0;
int prev_state17 = 0;
int prev_state18 = 0;
int prev_state19 = 0;
int prev_state20 = 0;
int prev_state21 = 0;
int prev_state22 = 0;
int prev_state23 = 0;
int prev_state24 = 0;
int prev_state25 = 0;
};
const int ent1 = 22; // Pines al que las entradas estan conectada
const int ent2 = 23;
const int ent3 = 24;
const int ent4 = 25;
const int ent5 = 26;
const int ent6 = 27;
const int ent7 = 28;
const int ent8 = 29;
const int ent9 = 30;
const int ent10 = 31;
const int ent11 = 32;
const int ent12 = 33;
const int ent13 = 34;
const int ent14 = 35;
const int ent15 = 36;
const int ent16 = 37;
const int ent17 = 38;
const int ent18 = 39;
const int ent19 = 40;
const int ent20 = 41;
const int ent21 = 42;
const int ent22 = 43;
const int ent23 = 44;
const int ent24 = 45;
const int ent25 = 46;
//give a name to the group of data
SEND_DATA_STRUCTURE mydata;
void setup(){
Serial1.begin(19200);
//start the library, pass in the data details and the name of the serial port. Can be Serial, Serial1, Serial2, etc.
Serial1.println(“CLEARDATA”);
Serial1.println(“LABEL, Fecha, Hora, Inyectora No., Estatus, Info., Comentarios, , Inyectora No., Estatus Actual, Estado”);
Serial1.println(“CELL,SET,H32,400”);
Serial1.println(“CELL,SET,H33,410”);
Serial1.println(“CELL,SET,H34,420”);
Serial1.println(“CELL,SET,H35,430”);
Serial1.println(“CELL,SET,H36,440”);
Serial1.println(“CELL,SET,H37,450”);
Serial1.println(“CELL,SET,H38,460”);
Serial1.println(“CELL,SET,H39,470”);
Serial1.println(“CELL,SET,H40,480”);
Serial1.println(“CELL,SET,H41,490”);
Serial1.println(“CELL,SET,H42,500”);
Serial1.println(“CELL,SET,H43,510”);
Serial1.println(“CELL,SET,H44,520”);
Serial1.println(“CELL,SET,H45,530”);
Serial1.println(“CELL,SET,H46,540”);
Serial1.println(“CELL,SET,H47,550”);
Serial1.println(“CELL,SET,H48,560”);
Serial1.println(“CELL,SET,H49,570”);
Serial1.println(“CELL,SET,H50,580”);
Serial1.println(“CELL,SET,H51,590”);
Serial1.println(“CELL,SET,H52,600”);
Serial1.println(“CELL,SET,H53,610”);
Serial1.println(“CELL,SET,H54,620”);
Serial1.println(“CELL,SET,H55,630”);
Serial1.println(“CELL,SET,H56,640”);
pinMode(ent1, INPUT_PULLUP);
pinMode(ent2, INPUT_PULLUP);
pinMode(ent3, INPUT_PULLUP);
pinMode(ent4, INPUT_PULLUP);
pinMode(ent5, INPUT_PULLUP);
pinMode(ent6, INPUT_PULLUP);
pinMode(ent7, INPUT_PULLUP);
pinMode(ent8, INPUT_PULLUP);
pinMode(ent9, INPUT_PULLUP);
pinMode(ent10, INPUT_PULLUP);
pinMode(ent11, INPUT_PULLUP);
pinMode(ent12, INPUT_PULLUP);
pinMode(ent13, INPUT_PULLUP);
pinMode(ent14, INPUT_PULLUP);
pinMode(ent15, INPUT_PULLUP);
pinMode(ent16, INPUT_PULLUP);
pinMode(ent17, INPUT_PULLUP);
pinMode(ent18, INPUT_PULLUP);
pinMode(ent19, INPUT_PULLUP);
pinMode(ent20, INPUT_PULLUP);
pinMode(ent21, INPUT_PULLUP);
pinMode(ent22, INPUT_PULLUP);
pinMode(ent23, INPUT_PULLUP);
pinMode(ent24, INPUT_PULLUP);
pinMode(ent25, INPUT_PULLUP);
mydata.state1 = digitalRead(ent1);
mydata.state2 = digitalRead(ent2);
mydata.state3 = digitalRead(ent3);
mydata.state4 = digitalRead(ent4);
mydata.state5 = digitalRead(ent5);
mydata.state6 = digitalRead(ent6);
mydata.state7 = digitalRead(ent7);
mydata.state8 = digitalRead(ent8);
mydata.state9 = digitalRead(ent9);
mydata.state10 = digitalRead(ent10);
mydata.state11 = digitalRead(ent11);
mydata.state12 = digitalRead(ent12);
mydata.state13 = digitalRead(ent13);
mydata.state14 = digitalRead(ent14);
mydata.state15 = digitalRead(ent15);
mydata.state16 = digitalRead(ent16);
mydata.state17 = digitalRead(ent17);
mydata.state18 = digitalRead(ent18);
mydata.state19 = digitalRead(ent19);
mydata.state20 = digitalRead(ent20);
mydata.state21 = digitalRead(ent21);
mydata.state22 = digitalRead(ent22);
mydata.state23 = digitalRead(ent23);
mydata.state24 = digitalRead(ent24);
mydata.state25 = digitalRead(ent25);
ET.begin(details(mydata), &Serial1);
//ET.sendData();
if (mydata.state1==HIGH){
Serial1.println(“CELL,SET,I32,PARADA”);
Serial1.println(“CELL,SET,J32,1”);
}
else {
Serial1.println(“CELL,SET,I32,TRABAJANDO”);
Serial1.println(“CELL,SET,J32,0”);
}
if (mydata.state2==HIGH){
Serial1.println(“CELL,SET,I33,PARADA”);
Serial1.println(“CELL,SET,J33,1”);
}
else {
Serial1.println(“CELL,SET,I33,TRABAJANDO”);
Serial1.println(“CELL,SET,J33,0”);
}
if (mydata.state3==HIGH){
Serial1.println(“CELL,SET,I34,PARADA”);
Serial1.println(“CELL,SET,J34,1”);
}
else {
Serial1.println(“CELL,SET,I34,TRABAJANDO”);
Serial1.println(“CELL,SET,J34,0”);
}
if (mydata.state4==HIGH){
Serial1.println(“CELL,SET,I35,PARADA”);
Serial1.println(“CELL,SET,J35,1”);
}
else {
Serial1.println(“CELL,SET,I35,TRABAJANDO”);
Serial1.println(“CELL,SET,J35,0”);
}
if (mydata.state5==HIGH){
Serial1.println(“CELL,SET,I36,PARADA”);
Serial1.println(“CELL,SET,J36,1”);
}
else {
Serial1.println(“CELL,SET,I36,TRABAJANDO”);
Serial1.println(“CELL,SET,J36,0”);
}
if (mydata.state6==HIGH){
Serial1.println(“CELL,SET,I37,PARADA”);
Serial1.println(“CELL,SET,J37,1”);
}
else {
Serial1.println(“CELL,SET,I37,TRABAJANDO”);
Serial1.println(“CELL,SET,J37,0”);
}
if (mydata.state7==HIGH){
Serial1.println(“CELL,SET,I38,PARADA”);
Serial1.println(“CELL,SET,J38,1”);
}
else {
Serial1.println(“CELL,SET,I38,TRABAJANDO”);
Serial1.println(“CELL,SET,J38,0”);
}
if (mydata.state8==HIGH){
Serial1.println(“CELL,SET,I39,PARADA”);
Serial1.println(“CELL,SET,J39,1”);
}
else {
Serial1.println(“CELL,SET,I39,TRABAJANDO”);
Serial1.println(“CELL,SET,J39,0”);
}
if (mydata.state9==HIGH){
Serial1.println(“CELL,SET,I40,PARADA”);
Serial1.println(“CELL,SET,J40,1”);
}
else {
Serial1.println(“CELL,SET,I40,TRABAJANDO”);
Serial1.println(“CELL,SET,J40,0”);
}
if (mydata.state10==HIGH){
Serial1.println(“CELL,SET,I41,PARADA”);
Serial1.println(“CELL,SET,J41,1”);
}
else {
Serial1.println(“CELL,SET,I41,TRABAJANDO”);
Serial1.println(“CELL,SET,J41,0”);
}
if (mydata.state11==HIGH){
Serial1.println(“CELL,SET,I42,PARADA”);
Serial1.println(“CELL,SET,J42,1”);
}
else {
Serial1.println(“CELL,SET,I42,TRABAJANDO”);
Serial1.println(“CELL,SET,J42,0”);
}
if (mydata.state12==HIGH){
Serial1.println(“CELL,SET,I43,PARADA”);
Serial1.println(“CELL,SET,J43,1”);
}
else {
Serial1.println(“CELL,SET,I43,TRABAJANDO”);
Serial1.println(“CELL,SET,J43,0”);
}
if (mydata.state13==HIGH){
Serial1.println(“CELL,SET,I44,PARADA”);
Serial1.println(“CELL,SET,J44,1”);
}
else {
Serial1.println(“CELL,SET,I44,TRABAJANDO”);
Serial1.println(“CELL,SET,J44,0”);
}
if (mydata.state14==HIGH){
Serial1.println(“CELL,SET,I45,PARADA”);
Serial1.println(“CELL,SET,J45,1”);
}
else {
Serial1.println(“CELL,SET,I45,TRABAJANDO”);
Serial1.println(“CELL,SET,J45,0”);
}
if (mydata.state15==HIGH){
Serial1.println(“CELL,SET,I46,PARADA”);
Serial1.println(“CELL,SET,J46,1”);
}
else {
Serial1.println(“CELL,SET,I46,TRABAJANDO”);
Serial1.println(“CELL,SET,J46,0”);
}
if (mydata.state16==HIGH){
Serial1.println(“CELL,SET,I47,PARADA”);
Serial1.println(“CELL,SET,J47,1”);
}
else {
Serial1.println(“CELL,SET,I47,TRABAJANDO”);
Serial1.println(“CELL,SET,J47,0”);
}
if (mydata.state17==HIGH){
Serial1.println(“CELL,SET,I48,PARADA”);
Serial1.println(“CELL,SET,J48,1”);
}
else {
Serial1.println(“CELL,SET,I48,TRABAJANDO”);
Serial1.println(“CELL,SET,J48,0”);
}
if (mydata.state18==HIGH){
Serial1.println(“CELL,SET,I49,PARADA”);
Serial1.println(“CELL,SET,J49,1”);
}
else {
Serial1.println(“CELL,SET,I49,TRABAJANDO”);
Serial1.println(“CELL,SET,J49,0”);
}
if (mydata.state19==HIGH){
Serial1.println(“CELL,SET,I50,PARADA”);
Serial1.println(“CELL,SET,J50,1”);
}
else {
Serial1.println(“CELL,SET,I50,TRABAJANDO”);
Serial1.println(“CELL,SET,J50,0”);
}
if (mydata.state20==HIGH){
Serial1.println(“CELL,SET,I51,PARADA”);
Serial1.println(“CELL,SET,J51,1”);
}
else {
Serial1.println(“CELL,SET,I51,TRABAJANDO”);
Serial1.println(“CELL,SET,J51,0”);
}
if (mydata.state21==HIGH){
Serial1.println(“CELL,SET,I52,PARADA”);
Serial1.println(“CELL,SET,J52,1”);
}
else {
Serial1.println(“CELL,SET,I52,TRABAJANDO”);
Serial1.println(“CELL,SET,J52,0”);
}
if (mydata.state22==HIGH){
Serial1.println(“CELL,SET,I53,PARADA”);
Serial1.println(“CELL,SET,J53,1”);
}
else {
Serial1.println(“CELL,SET,I53,TRABAJANDO”);
Serial1.println(“CELL,SET,J53,0”);
}
if (mydata.state23==HIGH){
Serial1.println(“CELL,SET,I54,PARADA”);
Serial1.println(“CELL,SET,J54,1”);
}
else {
Serial1.println(“CELL,SET,I54,TRABAJANDO”);
Serial1.println(“CELL,SET,J54,0”);
}
if (mydata.state24==HIGH){
Serial1.println(“CELL,SET,I55,PARADA”);
Serial1.println(“CELL,SET,J55,1”);
}
else {
Serial1.println(“CELL,SET,I55,TRABAJANDO”);
Serial1.println(“CELL,SET,J55,0”);
}
if (mydata.state25==HIGH){
Serial1.println(“CELL,SET,I56,PARADA”);
Serial1.println(“CELL,SET,J56,1”);
}
else {
Serial1.println(“CELL,SET,I56,TRABAJANDO”);
Serial1.println(“CELL,SET,J56,0”);
}
}
void loop(){
//this is how you access the variables. [name of the group].[variable name]
/* mydata.counter2=0;
mydata.prev_state1 = 0;
mydata.prev_state2 = 0;
mydata.prev_state3 = 0;
mydata.prev_state4 = 0;
mydata.prev_state5 = 0;
mydata.prev_state6 = 0;
mydata.prev_state7 = 0;
mydata.prev_state8 = 0;
mydata.prev_state9 = 0;
mydata.prev_state10 = 0;
mydata.prev_state11 = 0;
mydata.prev_state12 = 0;
mydata.prev_state13 = 0;
mydata.prev_state14 = 0;
mydata.prev_state15 = 0;
mydata.prev_state16 = 0;
mydata.prev_state17 = 0;
mydata.prev_state18 = 0;
mydata.prev_state19 = 0;
mydata.prev_state20 = 0;
mydata.prev_state21 = 0;
mydata.prev_state22 = 0;
mydata.prev_state23 = 0;
mydata.prev_state24 = 0;
mydata.prev_state25 = 0;
mydata.state1 = digitalRead(22);
mydata.state2 = digitalRead(23);
mydata.state3 = digitalRead(24);
mydata.state4 = digitalRead(25);
mydata.state5 = digitalRead(26);
mydata.state6 = digitalRead(27);
mydata.state7 = digitalRead(28);
mydata.state8 = digitalRead(29);
mydata.state9 = digitalRead(30);
mydata.state10 = digitalRead(31);
mydata.state11 = digitalRead(32);
mydata.state12 = digitalRead(33);
mydata.state13 = digitalRead(34);
mydata.state14 = digitalRead(35);
mydata.state15 = digitalRead(36);
mydata.state16 = digitalRead(37);
mydata.state17 = digitalRead(38);
mydata.state18 = digitalRead(39);
mydata.state19 = digitalRead(40);
mydata.state20 = digitalRead(41);
mydata.state21 = digitalRead(42);
mydata.state22 = digitalRead(43);
mydata.state23 = digitalRead(44);
mydata.state24 = digitalRead(45);
mydata.state25 = digitalRead(46);*/
//send the data
//ET.sendData();
//Just for fun, we will blink it out too
//—————————————–ENTRADA 1——————————————————————————————-
// comparar la entrada con su estado anterior
if (mydata.state1 != mydata.prev_state1) {
// si el estado ha cambiado incrementa el contador e indica un cambio de OFF->ON o ON->OFF
if (mydata.state1 == HIGH) {
// si el estado actual es alto entonces la entrada
// cambio de apagada a encendida (OFF->ON):
/*
Serial1.println(“DATA, DATE, TIME, 400, PARO”);
Serial1.println(“CELL,SET,I32,PARADA”);
Serial1.println(“CELL,SET,J32,1”);
*/
mydata.state1 = HIGH;
}else {
// si el estado actual es bajo entonces la entrada
// cambio de encendida a apagada (ON->OFF):
/* Serial1.println(“DATA, DATE, TIME, 400, ENCENDIO”);
Serial1.println(“CELL,SET,I32,TRABAJANDO”);
Serial1.println(“CELL,SET,J32,0”);
*/
mydata.state1 = LOW;
}
mydata.prev_state1 = mydata.state1;
mydata.counter2++;
delayMicroseconds(5);
}
if (mydata.counter2 == 5000)
{
mydata.counter2 = 0;
Serial1.println(“ROW,SET,2”);
}
ET.sendData();
delay(2000);
}
PD. Only put a one entry
and for my RX:
#include <EasyTransfer.h>
const int ent_1 = 22; // Pines al que las entradas estan conectada
const int ent_2 = 23;
const int ent_3 = 24;
const int ent_4 = 25;
const int ent_5 = 26;
const int ent_6 = 27;
const int ent_7 = 28;
const int ent_8 = 29;
const int ent_9 = 30;
const int ent_10 = 31;
const int ent_11 = 32;
const int ent_12 = 33;
const int ent_13 = 34;
const int ent_14 = 35;
const int ent_15 = 36;
const int ent_16 = 37;
const int ent_17 = 38;
const int ent_18 = 39;
const int ent_19 = 40;
const int ent_20 = 41;
const int ent_21 = 42;
const int ent_22 = 43;
const int ent_23 = 44;
const int ent_24 = 45;
const int ent_25 = 46;
const int ent_26 = 47;
const int ent_27 = 48;
const int ent_28 = 49;
const int ent_29 = 50;
const int ent_30 = 51;
// estas variables cambiaran:
// contador para el numero de cambios en las entradas
int counter = 0;
// estados de las entradas actuales
int state_1 = 0;
int state_2 = 0;
int state_3 = 0;
int state_4 = 0;
int state_5 = 0;
int state_6 = 0;
int state_7 = 0;
int state_8 = 0;
int state_9 = 0;
int state_10 = 0;
int state_11 = 0;
int state_12 = 0;
int state_13 = 0;
int state_14 = 0;
int state_15 = 0;
int state_16 = 0;
int state_17 = 0;
int state_18 = 0;
int state_19 = 0;
int state_20 = 0;
int state_21 = 0;
int state_22 = 0;
int state_23 = 0;
int state_24 = 0;
int state_25 = 0;
int state_26 = 0;
int state_27 = 0;
int state_28 = 0;
int state_29 = 0;
int state_30 = 0;
int prev_state_1 = 0; // estado previo de las entradas
int prev_state_2 = 0;
int prev_state_3 = 0;
int prev_state_4 = 0;
int prev_state_5 = 0;
int prev_state_6 = 0;
int prev_state_7 = 0;
int prev_state_8 = 0;
int prev_state_9 = 0;
int prev_state_10 = 0;
int prev_state_11 = 0;
int prev_state_12 = 0;
int prev_state_13 = 0;
int prev_state_14 = 0;
int prev_state_15 = 0;
int prev_state_16 = 0;
int prev_state_17 = 0;
int prev_state_18 = 0;
int prev_state_19 = 0;
int prev_state_20 = 0;
int prev_state_21 = 0;
int prev_state_22 = 0;
int prev_state_23 = 0;
int prev_state_24 = 0;
int prev_state_25 = 0;
int prev_state_26 = 0;
int prev_state_27 = 0;
int prev_state_28 = 0;
int prev_state_29 = 0;
int prev_state_30 = 0;
//create object
EasyTransfer ET;
struct RECEIVE_DATA_STRUCTURE{
//put your variable definitions here for the data you want to receive
//THIS MUST BE EXACTLY THE SAME ON THE OTHER ARDUINO
int counter2;
// estados de las entradas actuales
int state1;
int state2;
int state3;
int state4;
int state5;
int state6;
int state7;
int state8;
int state9;
int state10;
int state11;
int state12;
int state13;
int state14;
int state15;
int state16 ;
int state17;
int state18;
int state19;
int state20;
int state21;
int state22;
int state23 ;
int state24 ;
int state25 ;
int prev_state1=0; // estado previo de las entradas
int prev_state2=0;
int prev_state3 =0;
int prev_state4=0 ;
int prev_state5=0;
int prev_state6=0 ;
int prev_state7=0;
int prev_state8=0;
int prev_state9=0;
int prev_state10=0;
int prev_state11=0;
int prev_state12=0;
int prev_state13=0;
int prev_state14=0;
int prev_state15=0;
int prev_state16=0;
int prev_state17=0;
int prev_state18=0;
int prev_state19=0;
int prev_state20=0;
int prev_state21=0;
int prev_state22=0;
int prev_state23=0;
int prev_state24=0;
int prev_state25=0;
};
//give a name to the group of data
RECEIVE_DATA_STRUCTURE mydata;
void setup(){
Serial1.begin(19200);
Serial.begin(19200);
Serial.println(“CLEARDATA”);
Serial.println(“LABEL, Fecha, Hora, Inyectora No., Estatus, Info., Comentarios, , Inyectora No., Estatus Actual, Estado”);
Serial.println(“CELL,SET,H2,100”);
Serial.println(“CELL,SET,H3,110”);
Serial.println(“CELL,SET,H4,120”);
Serial.println(“CELL,SET,H5,130”);
Serial.println(“CELL,SET,H6,140”);
Serial.println(“CELL,SET,H7,150”);
Serial.println(“CELL,SET,H8,160”);
Serial.println(“CELL,SET,H9,170”);
Serial.println(“CELL,SET,H10,180”);
Serial.println(“CELL,SET,H11,190”);
Serial.println(“CELL,SET,H12,200”);
Serial.println(“CELL,SET,H13,210”);
Serial.println(“CELL,SET,H14,220”);
Serial.println(“CELL,SET,H15,230”);
Serial.println(“CELL,SET,H16,240”);
Serial.println(“CELL,SET,H17,250”);
Serial.println(“CELL,SET,H18,260”);
Serial.println(“CELL,SET,H19,270”);
Serial.println(“CELL,SET,H20,280”);
Serial.println(“CELL,SET,H21,290”);
Serial.println(“CELL,SET,H22,300”);
Serial.println(“CELL,SET,H23,310”);
Serial.println(“CELL,SET,H24,320”);
Serial.println(“CELL,SET,H25,330”);
Serial.println(“CELL,SET,H26,340”);
Serial.println(“CELL,SET,H27,350”);
Serial.println(“CELL,SET,H28,360”);
Serial.println(“CELL,SET,H29,370”);
Serial.println(“CELL,SET,H30,380”);
Serial.println(“CELL,SET,H31,390”);
Serial.println(“CELL,SET,H32,400”);
Serial.println(“CELL,SET,H33,410”);
Serial.println(“CELL,SET,H34,420”);
Serial.println(“CELL,SET,H35,430”);
Serial.println(“CELL,SET,H36,440”);
Serial.println(“CELL,SET,H37,450”);
Serial.println(“CELL,SET,H38,460”);
Serial.println(“CELL,SET,H39,470”);
Serial.println(“CELL,SET,H40,480”);
Serial.println(“CELL,SET,H41,490”);
Serial.println(“CELL,SET,H42,500”);
Serial.println(“CELL,SET,H43,510”);
Serial.println(“CELL,SET,H44,520”);
Serial.println(“CELL,SET,H45,530”);
Serial.println(“CELL,SET,H46,540”);
Serial.println(“CELL,SET,H47,550”);
Serial.println(“CELL,SET,H48,560”);
Serial.println(“CELL,SET,H49,570”);
Serial.println(“CELL,SET,H50,580”);
Serial.println(“CELL,SET,H51,590”);
Serial.println(“CELL,SET,H52,600”);
Serial.println(“CELL,SET,H53,610”);
Serial.println(“CELL,SET,H54,620”);
Serial.println(“CELL,SET,H55,630”);
Serial.println(“CELL,SET,H56,640”);
// inicializa los pines como una entrada:
pinMode(ent_1, INPUT_PULLUP);
pinMode(ent_2, INPUT_PULLUP);
pinMode(ent_3, INPUT_PULLUP);
pinMode(ent_4, INPUT_PULLUP);
pinMode(ent_5, INPUT_PULLUP);
pinMode(ent_6, INPUT_PULLUP);
pinMode(ent_7, INPUT_PULLUP);
pinMode(ent_8, INPUT_PULLUP);
pinMode(ent_9, INPUT_PULLUP);
pinMode(ent_10, INPUT_PULLUP);
pinMode(ent_11, INPUT_PULLUP);
pinMode(ent_12, INPUT_PULLUP);
pinMode(ent_13, INPUT_PULLUP);
pinMode(ent_14, INPUT_PULLUP);
pinMode(ent_15, INPUT_PULLUP);
pinMode(ent_16, INPUT_PULLUP);
pinMode(ent_17, INPUT_PULLUP);
pinMode(ent_18, INPUT_PULLUP);
pinMode(ent_19, INPUT_PULLUP);
pinMode(ent_20, INPUT_PULLUP);
pinMode(ent_21, INPUT_PULLUP);
pinMode(ent_22, INPUT_PULLUP);
pinMode(ent_23, INPUT_PULLUP);
pinMode(ent_24, INPUT_PULLUP);
pinMode(ent_25, INPUT_PULLUP);
pinMode(ent_26, INPUT_PULLUP);
pinMode(ent_27, INPUT_PULLUP);
pinMode(ent_28, INPUT_PULLUP);
pinMode(ent_29, INPUT_PULLUP);
pinMode(ent_30, INPUT_PULLUP);
state_1 = digitalRead(ent_1);
state_2 = digitalRead(ent_2);
state_3 = digitalRead(ent_3);
state_4 = digitalRead(ent_4);
state_5 = digitalRead(ent_5);
state_6 = digitalRead(ent_6);
state_7 = digitalRead(ent_7);
state_8 = digitalRead(ent_8);
state_9 = digitalRead(ent_9);
state_10 = digitalRead(ent_10);
state_11 = digitalRead(ent_11);
state_12 = digitalRead(ent_12);
state_13 = digitalRead(ent_13);
state_14 = digitalRead(ent_14);
state_15 = digitalRead(ent_15);
state_16 = digitalRead(ent_16);
state_17 = digitalRead(ent_17);
state_18 = digitalRead(ent_18);
state_19 = digitalRead(ent_19);
state_20 = digitalRead(ent_20);
state_21 = digitalRead(ent_21);
state_22 = digitalRead(ent_22);
state_23 = digitalRead(ent_23);
state_24 = digitalRead(ent_24);
state_25 = digitalRead(ent_25);
state_26 = digitalRead(ent_26);
state_27 = digitalRead(ent_27);
state_28 = digitalRead(ent_28);
state_29 = digitalRead(ent_29);
state_30 = digitalRead(ent_30);
if (state_1==HIGH){
Serial.println(F(“CELL,SET,I2,PARADA”));
Serial.println(F(“CELL,SET,J2,1”));
}
else {
Serial.println(F(“CELL,SET,I2,TRABAJANDO”));
Serial.println(F(“CELL,SET,J2,0”));
}
if (state_2==HIGH){
Serial.println(F(“CELL,SET,I3,PARADA”));
Serial.println(F(“CELL,SET,J3,1”));
}
else {
Serial.println(F(“CELL,SET,I3,TRABAJANDO”));
Serial.println(F(“CELL,SET,J3,0”));
}
if (state_3==HIGH){
Serial.println(F(“CELL,SET,I4,PARADA”));
Serial.println(F(“CELL,SET,J4,1”));
}
else {
Serial.println(F(“CELL,SET,I4,TRABAJANDO”));
Serial.println(F(“CELL,SET,J4,0”));
}
if (state_4==HIGH){
Serial.println(F(“CELL,SET,I5,PARADA”));
Serial.println(F(“CELL,SET,J5,1”));
}
else {
Serial.println(F(“CELL,SET,I5,TRABAJANDO”));
Serial.println(F(“CELL,SET,J5,0”));
}
if (state_5==HIGH){
Serial.println(F(“CELL,SET,I6,PARADA”));
Serial.println(F(“CELL,SET,J6,1”));
}
else {
Serial.println(F(“CELL,SET,I6,TRABAJANDO”));
Serial.println(F(“CELL,SET,J6,0”));
}
if (state_6==HIGH){
Serial.println(F(“CELL,SET,I7,PARADA”));
Serial.println(F(“CELL,SET,J7,1”));
}
else {
Serial.println(F(“CELL,SET,I7,TRABAJANDO”));
Serial.println(F(“CELL,SET,J7,0”));
}
if (state_7==HIGH){
Serial.println(F(“CELL,SET,I8,PARADA”));
Serial.println(F(“CELL,SET,J8,1”));
}
else {
Serial.println(F(“CELL,SET,I8,TRABAJANDO”));
Serial.println(F(“CELL,SET,J8,0”));
}
if (state_8==HIGH){
Serial.println(F(“CELL,SET,I9,PARADA”));
Serial.println(F(“CELL,SET,J9,1”));
}
else {
Serial.println(F(“CELL,SET,I9,TRABAJANDO”));
Serial.println(F(“CELL,SET,J9,0”));
}
if (state_9==HIGH){
Serial.println(F(“CELL,SET,I10,PARADA”));
Serial.println(F(“CELL,SET,J10,1”));
}
else {
Serial.println(F(“CELL,SET,I10,TRABAJANDO”));
Serial.println(F(“CELL,SET,J10,0”));
}
if (state_10==HIGH){
Serial.println(F(“CELL,SET,I11,PARADA”));
Serial.println(F(“CELL,SET,J11,1”));
}
else {
Serial.println(F(“CELL,SET,I11,TRABAJANDO”));
Serial.println(F(“CELL,SET,J11,0”));
}
if (state_11==HIGH){
Serial.println(F(“CELL,SET,I12,PARADA”));
Serial.println(F(“CELL,SET,J12,1”));
}
else {
Serial.println(F(“CELL,SET,I12,TRABAJANDO”));
Serial.println(F(“CELL,SET,J12,0”));
}
if (state_12==HIGH){
Serial.println(F(“CELL,SET,I13,PARADA”));
Serial.println(F(“CELL,SET,J13,1”));
}
else {
Serial.println(F(“CELL,SET,I13,TRABAJANDO”));
Serial.println(F(“CELL,SET,J13,0”));
}
if (state_13==HIGH){
Serial.println(F(“CELL,SET,I14,PARADA”));
Serial.println(F(“CELL,SET,J14,1”));
}
else {
Serial.println(F(“CELL,SET,I14,TRABAJANDO”));
Serial.println(F(“CELL,SET,J14,0”));
}
if (state_14==HIGH){
Serial.println(F(“CELL,SET,I15,PARADA”));
Serial.println(F(“CELL,SET,J15,1”));
}
else {
Serial.println(F(“CELL,SET,I15,TRABAJANDO”));
Serial.println(F(“CELL,SET,J15,0”));
}
if (state_15==HIGH){
Serial.println(F(“CELL,SET,I16,PARADA”));
Serial.println(F(“CELL,SET,J16,1”));
}
else {
Serial.println(F(“CELL,SET,I16,TRABAJANDO”));
Serial.println(F(“CELL,SET,J16,0”));
}
if (state_16==HIGH){
Serial.println(F(“CELL,SET,I17,PARADA”));
Serial.println(F(“CELL,SET,J17,1”));
}
else {
Serial.println(F(“CELL,SET,I17,TRABAJANDO”));
Serial.println(F(“CELL,SET,J17,0”));
}
if (state_17==HIGH){
Serial.println(F(“CELL,SET,I18,PARADA”));
Serial.println(F(“CELL,SET,J18,1”));
}
else {
Serial.println(F(“CELL,SET,I18,TRABAJANDO”));
Serial.println(F(“CELL,SET,J18,0”));
}
if (state_18==HIGH){
Serial.println(F(“CELL,SET,I19,PARADA”));
Serial.println(F(“CELL,SET,J19,1”));
}
else {
Serial.println(F(“CELL,SET,I19,TRABAJANDO”));
Serial.println(F(“CELL,SET,J19,0”));
}
if (state_19==HIGH){
Serial.println(F(“CELL,SET,I20,PARADA”));
Serial.println(F(“CELL,SET,J20,1”));
}
else {
Serial.println(F(“CELL,SET,I20,TRABAJANDO”));
Serial.println(F(“CELL,SET,J20,0”));
}
if (state_20==HIGH){
Serial.println(F(“CELL,SET,I21,PARADA”));
Serial.println(F(“CELL,SET,J21,1”));
}
else {
Serial.println(F(“CELL,SET,I21,TRABAJANDO”));
Serial.println(F(“CELL,SET,J21,0”));
}
if (state_21==HIGH){
Serial.println(F(“CELL,SET,I22,PARADA”));
Serial.println(F(“CELL,SET,J22,1”));
}
else {
Serial.println(F(“CELL,SET,I22,TRABAJANDO”));
Serial.println(F(“CELL,SET,J22,0”));
}
if (state_22==HIGH){
Serial.println(F(“CELL,SET,I23,PARADA”));
Serial.println(F(“CELL,SET,J23,1”));
}
else {
Serial.println(F(“CELL,SET,I23,TRABAJANDO”));
Serial.println(F(“CELL,SET,J23,0”));
}
if (state_23==HIGH){
Serial.println(F(“CELL,SET,I24,PARADA”));
Serial.println(F(“CELL,SET,J24,1”));
}
else {
Serial.println(F(“CELL,SET,I24,TRABAJANDO”));
Serial.println(F(“CELL,SET,J24,0”));
}
if (state_24==HIGH){
Serial.println(F(“CELL,SET,I25,PARADA”));
Serial.println(F(“CELL,SET,J25,1”));
}
else {
Serial.println(F(“CELL,SET,I25,TRABAJANDO”));
Serial.println(F(“CELL,SET,J25,0”));
}
if (state_25==HIGH){
Serial.println(F(“CELL,SET,I26,PARADA”));
Serial.println(F(“CELL,SET,J26,1”));
}
else {
Serial.println(F(“CELL,SET,I26,TRABAJANDO”));
Serial.println(F(“CELL,SET,J26,0”));
}
if (state_26==HIGH){
Serial.println(F(“CELL,SET,I27,PARADA”));
Serial.println(F(“CELL,SET,J27,1”));
}
else {
Serial.println(F(“CELL,SET,I27,TRABAJANDO”));
Serial.println(F(“CELL,SET,J27,0”));
}
if (state_27==HIGH){
Serial.println(F(“CELL,SET,I28,PARADA”));
Serial.println(F(“CELL,SET,J28,1”));
}
else {
Serial.println(F(“CELL,SET,I28,TRABAJANDO”));
Serial.println(F(“CELL,SET,J28,0”));
}
if (state_28==HIGH){
Serial.println(F(“CELL,SET,I29,PARADA”));
Serial.println(F(“CELL,SET,J29,1”));
}
else {
Serial.println(F(“CELL,SET,I29,TRABAJANDO”));
Serial.println(F(“CELL,SET,J29,0”));
}
if (state_29==HIGH){
Serial.println(F(“CELL,SET,I30,PARADA”));
Serial.println(F(“CELL,SET,J30,1”));
}
else {
Serial.println(F(“CELL,SET,I30,TRABAJANDO”));
Serial.println(F(“CELL,SET,J30,0”));
}
if (state_30==HIGH){
Serial.println(F(“CELL,SET,I31,PARADA”));
Serial.println(F(“CELL,SET,J31,1”));
}
else {
Serial.println(F(“CELL,SET,I31,TRABAJANDO”));
Serial.println(F(“CELL,SET,J31,0”));
}
//start the library, pass in the data details and the name of the serial port. Can be Serial, Serial1, Serial2, etc.
ET.begin(details(mydata), &Serial1);
/*pinMode(22, INPUT_PULLUP);
pinMode(23, INPUT_PULLUP);
pinMode(24, INPUT_PULLUP);
pinMode(25, INPUT_PULLUP);
pinMode(26, INPUT_PULLUP);
pinMode(27, INPUT_PULLUP);
pinMode(28, INPUT_PULLUP);
pinMode(29, INPUT_PULLUP);
pinMode(30, INPUT_PULLUP);
pinMode(31, INPUT_PULLUP);
pinMode(32, INPUT_PULLUP);
pinMode(33, INPUT_PULLUP);
pinMode(34, INPUT_PULLUP);
pinMode(35, INPUT_PULLUP);
pinMode(36, INPUT_PULLUP);
pinMode(37, INPUT_PULLUP);
pinMode(38, INPUT_PULLUP);
pinMode(39, INPUT_PULLUP);
pinMode(40, INPUT_PULLUP);
pinMode(41, INPUT_PULLUP);
pinMode(42, INPUT_PULLUP);
pinMode(43, INPUT_PULLUP);
pinMode(44, INPUT_PULLUP);
pinMode(45, INPUT_PULLUP);
pinMode(46, INPUT_PULLUP);
mydata.state1 = digitalRead(22);
mydata.state2 = digitalRead(23);
mydata.state3 = digitalRead(24);
mydata.state4 = digitalRead(25);
mydata.state5 = digitalRead(26);
mydata.state6 = digitalRead(27);
mydata.state7 = digitalRead(28);
mydata.state8 = digitalRead(29);
mydata.state9 = digitalRead(30);
mydata.state10 = digitalRead(31);
mydata.state11 = digitalRead(32);
mydata.state12 = digitalRead(33);
mydata.state13 = digitalRead(34);
mydata.state14 = digitalRead(35);
mydata.state15 = digitalRead(36);
mydata.state16 = digitalRead(37);
mydata.state17 = digitalRead(38);
mydata.state18 = digitalRead(39);
mydata.state19 = digitalRead(40);
mydata.state20 = digitalRead(41);
mydata.state21 = digitalRead(42);
mydata.state22 = digitalRead(43);
mydata.state23 = digitalRead(44);
mydata.state24 = digitalRead(45);
mydata.state25 = digitalRead(46);*/
if (mydata.state1==HIGH){
Serial.println(“CELL,SET,I32,PARADA”);
Serial.println(“CELL,SET,J32,1”);
}
else {
Serial.println(“CELL,SET,I32,TRABAJANDO”);
Serial.println(“CELL,SET,J32,0”);
}
if (mydata.state2==HIGH){
Serial.println(“CELL,SET,I33,PARADA”);
Serial.println(“CELL,SET,J33,1”);
}
else {
Serial.println(“CELL,SET,I33,TRABAJANDO”);
Serial.println(“CELL,SET,J33,0”);
}
if (mydata.state3==HIGH){
Serial.println(“CELL,SET,I34,PARADA”);
Serial.println(“CELL,SET,J34,1”);
}
else {
Serial.println(“CELL,SET,I34,TRABAJANDO”);
Serial.println(“CELL,SET,J34,0”);
}
if (mydata.state4==HIGH){
Serial.println(“CELL,SET,I35,PARADA”);
Serial.println(“CELL,SET,J35,1”);
}
else {
Serial.println(“CELL,SET,I35,TRABAJANDO”);
Serial.println(“CELL,SET,J35,0”);
}
if (mydata.state5==HIGH){
Serial.println(“CELL,SET,I36,PARADA”);
Serial.println(“CELL,SET,J36,1”);
}
else {
Serial.println(“CELL,SET,I36,TRABAJANDO”);
Serial.println(“CELL,SET,J36,0”);
}
if (mydata.state6==HIGH){
Serial.println(“CELL,SET,I37,PARADA”);
Serial.println(“CELL,SET,J37,1”);
}
else {
Serial.println(“CELL,SET,I37,TRABAJANDO”);
Serial.println(“CELL,SET,J37,0”);
}
if (mydata.state7==HIGH){
Serial.println(“CELL,SET,I38,PARADA”);
Serial.println(“CELL,SET,J38,1”);
}
else {
Serial.println(“CELL,SET,I38,TRABAJANDO”);
Serial.println(“CELL,SET,J38,0”);
}
if (mydata.state8==HIGH){
Serial.println(“CELL,SET,I39,PARADA”);
Serial.println(“CELL,SET,J39,1”);
}
else {
Serial.println(“CELL,SET,I39,TRABAJANDO”);
Serial.println(“CELL,SET,J39,0”);
}
if (mydata.state9==HIGH){
Serial.println(“CELL,SET,I40,PARADA”);
Serial.println(“CELL,SET,J40,1”);
}
else {
Serial.println(“CELL,SET,I40,TRABAJANDO”);
Serial.println(“CELL,SET,J40,0”);
}
if (mydata.state10==HIGH){
Serial.println(“CELL,SET,I41,PARADA”);
Serial.println(“CELL,SET,J41,1”);
}
else {
Serial.println(“CELL,SET,I41,TRABAJANDO”);
Serial.println(“CELL,SET,J41,0”);
}
if (mydata.state11==HIGH){
Serial.println(“CELL,SET,I42,PARADA”);
Serial.println(“CELL,SET,J42,1”);
}
else {
Serial.println(“CELL,SET,I42,TRABAJANDO”);
Serial.println(“CELL,SET,J42,0”);
}
if (mydata.state12==HIGH){
Serial.println(“CELL,SET,I43,PARADA”);
Serial.println(“CELL,SET,J43,1”);
}
else {
Serial.println(“CELL,SET,I43,TRABAJANDO”);
Serial.println(“CELL,SET,J43,0”);
}
if (mydata.state13==HIGH){
Serial.println(“CELL,SET,I44,PARADA”);
Serial.println(“CELL,SET,J44,1”);
}
else {
Serial.println(“CELL,SET,I44,TRABAJANDO”);
Serial.println(“CELL,SET,J44,0”);
}
if (mydata.state14==HIGH){
Serial.println(“CELL,SET,I45,PARADA”);
Serial.println(“CELL,SET,J45,1”);
}
else {
Serial.println(“CELL,SET,I45,TRABAJANDO”);
Serial.println(“CELL,SET,J45,0”);
}
if (mydata.state15==HIGH){
Serial.println(“CELL,SET,I46,PARADA”);
Serial.println(“CELL,SET,J46,1”);
}
else {
Serial.println(“CELL,SET,I46,TRABAJANDO”);
Serial.println(“CELL,SET,J46,0”);
}
if (mydata.state16==HIGH){
Serial.println(“CELL,SET,I47,PARADA”);
Serial.println(“CELL,SET,J47,1”);
}
else {
Serial.println(“CELL,SET,I47,TRABAJANDO”);
Serial.println(“CELL,SET,J47,0”);
}
if (mydata.state17==HIGH){
Serial.println(“CELL,SET,I48,PARADA”);
Serial.println(“CELL,SET,J48,1”);
}
else {
Serial.println(“CELL,SET,I48,TRABAJANDO”);
Serial.println(“CELL,SET,J48,0”);
}
if (mydata.state18==HIGH){
Serial.println(“CELL,SET,I49,PARADA”);
Serial.println(“CELL,SET,J49,1”);
}
else {
Serial.println(“CELL,SET,I49,TRABAJANDO”);
Serial.println(“CELL,SET,J49,0”);
}
if (mydata.state19==HIGH){
Serial.println(“CELL,SET,I50,PARADA”);
Serial.println(“CELL,SET,J50,1”);
}
else {
Serial.println(“CELL,SET,I50,TRABAJANDO”);
Serial.println(“CELL,SET,J50,0”);
}
if (mydata.state20==HIGH){
Serial.println(“CELL,SET,I51,PARADA”);
Serial.println(“CELL,SET,J51,1”);
}
else {
Serial.println(“CELL,SET,I51,TRABAJANDO”);
Serial.println(“CELL,SET,J51,0”);
}
if (mydata.state21==HIGH){
Serial.println(“CELL,SET,I52,PARADA”);
Serial.println(“CELL,SET,J52,1”);
}
else {
Serial.println(“CELL,SET,I52,TRABAJANDO”);
Serial.println(“CELL,SET,J52,0”);
}
if (mydata.state22==HIGH){
Serial.println(“CELL,SET,I53,PARADA”);
Serial.println(“CELL,SET,J53,1”);
}
else {
Serial.println(“CELL,SET,I53,TRABAJANDO”);
Serial.println(“CELL,SET,J53,0”);
}
if (mydata.state23==HIGH){
Serial.println(“CELL,SET,I54,PARADA”);
Serial.println(“CELL,SET,J54,1”);
}
else {
Serial.println(“CELL,SET,I54,TRABAJANDO”);
Serial.println(“CELL,SET,J54,0”);
}
if (mydata.state24==HIGH){
Serial.println(“CELL,SET,I55,PARADA”);
Serial.println(“CELL,SET,J55,1”);
}
else {
Serial.println(“CELL,SET,I55,TRABAJANDO”);
Serial.println(“CELL,SET,J55,0”);
}
if (mydata.state25==HIGH){
Serial.println(“CELL,SET,I56,PARADA”);
Serial.println(“CELL,SET,J56,1”);
}
else {
Serial.println(“CELL,SET,I56,TRABAJANDO”);
Serial.println(“CELL,SET,J56,0”);
}
}
void loop(){
//check and see if a data packet has come in.
state_1 = digitalRead(ent_1);
state_2 = digitalRead(ent_2);
state_3 = digitalRead(ent_3);
state_4 = digitalRead(ent_4);
state_5 = digitalRead(ent_5);
state_6 = digitalRead(ent_6);
state_7 = digitalRead(ent_7);
state_8 = digitalRead(ent_8);
state_9 = digitalRead(ent_9);
state_10 = digitalRead(ent_10);
state_11 = digitalRead(ent_11);
state_12 = digitalRead(ent_12);
state_13 = digitalRead(ent_13);
state_14 = digitalRead(ent_14);
state_15 = digitalRead(ent_15);
state_16 = digitalRead(ent_16);
state_17 = digitalRead(ent_17);
state_18 = digitalRead(ent_18);
state_19 = digitalRead(ent_19);
state_20 = digitalRead(ent_20);
state_21 = digitalRead(ent_21);
state_22 = digitalRead(ent_22);
state_23 = digitalRead(ent_23);
state_24 = digitalRead(ent_24);
state_25 = digitalRead(ent_25);
state_26 = digitalRead(ent_26);
state_27 = digitalRead(ent_27);
state_28 = digitalRead(ent_28);
state_29 = digitalRead(ent_29);
state_30 = digitalRead(ent_30);
//—————————————-ENTRADA 1——————————————————————————————-
// comparar la entrada con su estado anterior
if (state_1 != prev_state_1) {
// si el estado ha cambiado incrementa el contador e indica un cambio de OFF->ON o ON->OFF
if (state_1 == HIGH) {
// si el estado actual es alto entonces la entrada
// cambio de apagada a encendida (OFF->ON):
Serial.println(F(“DATA, DATE, TIME, 100, PARO”));
Serial.println(F(“CELL,SET,I2,PARADA”));
Serial.println(F(“CELL,SET,J2,1”));
}
else {
// si el estado actual es bajo entonces la entrada
// cambio de encendida a apagada (ON->OFF):
Serial.println(F(“DATA, DATE, TIME, 100, ENCENDIO”));
Serial.println(F(“CELL,SET,I2,TRABAJANDO”));
Serial.println(F(“CELL,SET,J2,0”));
}
// Retraso para evitar inestabilidad entre una lectura y otra
// guarda el estado actual como el estado previo,
// para la siguiente ejecucion del ciclo
prev_state_1 = state_1;
counter++;
delayMicroseconds(10);
}
if(ET.receiveData()){
//—————————————–ENTRADA 1——————————————————————————————-
if (mydata.state1 != mydata.prev_state1) {
// si el estado ha cambiado incrementa el contador e indica un cambio de OFF->ON o ON->OFF
if (mydata.state1 == HIGH) {
// si el estado actual es alto entonces la entrada
// cambio de apagada a encendida (OFF->ON):
Serial.println(“DATA, DATE, TIME, 400, PARO”);
Serial.println(“CELL,SET,I32,PARADA”);
Serial.println(“CELL,SET,J32,1”);
/* if (mydata.state1 == mydata.prev_state1) {
Serial.println(“DATA, DATE, TIME, 400, PARO”);
}*/
}
else {
// si el estado actual es bajo entonces la entrada
// cambio de encendida a apagada (ON->OFF):
Serial.println(“DATA, DATE, TIME, 400, ENCENDIO”);
Serial.println(“CELL,SET,I32,TRABAJANDO”);
Serial.println(“CELL,SET,J32,0”);
/*if (mydata.state1 != mydata.prev_state1) {
Serial.println(“DATA, DATE, TIME, 400, ENCENDIO”);
}*/
}
// Retraso para evitar inestabilidad entre una lectura y otra
// guarda el estado actual como el estado previo,
// para la siguiente ejecucion del ciclo
/* mydata.prev_state1 = mydata.state1;
mydata.counter2++;*/
delay(5);
}
if (mydata.counter2 == 5000)
{
mydata.counter2 = 0;
Serial.println(“ROW,SET,2”);
}
//you should make this delay shorter then your transmit delay or else messages could be lost
delay(200);
}
}
October 30, 2015 at 9:41 am #3379AnonymousInactiveI solved it, thanks
-
AuthorPosts
- You must be logged in to reply to this topic.