#include <EEPROM.h>
int SIZEOFVARS = 0;
bool ABS=false;
bool MBRK=true;
bool MBRKS=true;
bool MTMPS=true;
bool MBRKTMPS=false;
bool MTHPP=false;
bool VFD=true;
bool V37=false;
bool MLSR=true;
bool MLSP=true;
bool MLSPLOP=false;
bool MLSPLCP=false;
bool MLSPLPP=false;
bool MLSPLOS=false;
bool MLSPLCS=false;
bool MLSPLPS=false;
bool MCSP=false;
bool MPLP=false;
bool OLS=false;
bool CLS=false;
bool PLS=false;
bool POA=false;
bool OTC=false;
bool OTO=false;
bool MA=false;
bool ILCK=false;
bool CAOC=false;
bool CACC=false;
bool CASC=false;
bool CAC=false;
bool CILCK=false;
bool BPS=false;
bool SO=false;
bool FMP=false;
bool ELDP=false;
bool DOLCKSP=false;
bool DOLCKBP=false;
bool TAOP=false;
bool DMNMA=false;
bool DIROK=false;
bool WDP=false;
bool MOSP=false;
bool PLCK=false;
bool STEPRM=false;
bool BTP=false;
bool ETHP=false;
bool WIFIP=false;
bool WIFIA=false;
bool APOS=false;
bool CAMP=false;
bool SDP=false;
bool USBP=false;
bool RDOP=false;
bool FPSP=false;
bool RFIDP=false;
bool DSPP=false;
bool MENSP=false;
bool linkok=false;
bool DOP=false;
bool DCL=false;
bool DPL=false;
bool seccomp=true;
bool WRNL=false;
bool CTSYL=false;
bool TLGI=false;
bool TLGO=false;
bool TLRI=false;
bool TLRO=false;
bool WRNS=false;
char FWV[20] = "1.01";
char DT[50] = "Fold up";
char MT[50] = "DC Motor with Add-on VFD";
char MCT[2] = "DC";
char MPF[10] = "1";
char MPW[10] = "750W";
char MFC[10] = "250kg";
char MDW[10] = "250kg";
char MSL[10] = "0001010";
char MDL[50] = "RCK750";
char MMN[100] = "CHINESE";
char MDT[10] = "OCT2019";
char ABST[10] = "";
char MBRKT[10] = "Addon";
char MBRKCT[2] = "AC";
char VFDT[10] = "Addon";
char CDS[50] = "";
char CA[50] = "";
char ATBT[50] = "NONE";
char PUA[50] = "CLOSE";
char MDOOBTN[10] = "CORRECT";
char RDPT[10] = "";
char fncname[25] = "NONE";
int MPC=1;
int MFQ=100;
int MBRKTG=0;
int MBRKSS=1;
int MBRKIS=1;
int MTHPS=0;
int MOP=0;
int MCL=0;
int MPLS=0;
const int NOOS=6;
const int NOCS=6;
const int NOPS=4;
const int NOPTOOS=3;
int CMFQ=0;
int CMOSCTR=0;
int CMCSCTR=0;
int ILCKS=0;
int ACA=0;
int ATBTNUM=0;
int TCT=0;
int FMA=0;
int ELDS=0;
int ESA=0;
int DOLCKS=0;
int DOLCK=0;
int ILCKODO=0;
int ILCKODC=0;
int DMDNA=0;
int WDC=0;
int MOM=0;
int PLCKS=0;
const int CINP=42;
const int COUTP=18;
const int CIOP=6;
const int CSFTY=6;
const int CGRP=0;
int MENSS=1;
int xi=0;
int exenum=0;
const int fncount=24;
long MOV=36;
long MXC=7;
long MGL=5000;
long MBRKV=220;
long MBRKC=0.5;
long MTMPRD=0;
long MBRKTMPRD=0;
long MTHPT=0;
long ABSOL=0;
long ABSCL=0;
long ABSPL=0;
long CDPFC=0;
long CDPFO=0;
long NCOSAT=0;
long NCCSAT=0;
long OSDTRC=0;
long OSDTRO=0;
long OSSECTRC=0;
long OSSECTRO=0;
boolean varwritten = false;
boolean arraywritten = false;
int eeAddress = 100;
struct ios_a
{
char Pin[3];
char typ[1];
int grp;
int grpsz;
int Item;
char datat[1];
int cmd;
int xfn;
int cmdexe;
int vars;
int varp;
char XD[10];
};
struct ios_a in_a[CINP] =
{{ 'D14','B',3,0,0,'D',0,3,3,0,0,'E'},
{ 'D15','B',3,0,0,'D',0,3,3,0,0,'E'},
{ 'D16','B',1,1,28,'D',17,0,3,414,7,'E'},
{ 'D17','B',1,0,29,'D',17,0,3,414,7,'E'},
{ 'D18','B',1,1,32,'D',18,2,3,58,62,'E'},
{ 'D19','B',1,0,33,'D',18,2,3,58,62,'E'},
{ 'D20','B',3,0,0,'D',0,3,3,0,0,'E'},
{ 'D21','B',3,0,0,'D',0,3,3,0,0,'E'},
{ 'D22','I',0,0,41,'S',11,0,1,0,0,'E'},
{ 'D23','I',0,0,42,'S',14,0,0,0,0,'E'},
{ 'D24','I',0,0,40,'S',3,0,1,0,0,'E'},
{ 'D25','I',0,0,31,'S',5,0,1,223,0,'E'},
{ 'D26','I',0,0,18,'S',19,0,0,207,10,'E'},
{ 'D27','I',0,0,17,'S',20,0,0,208,10,'E'},
{ 'D28','I',0,0,19,'S',21,0,0,209,18,'E'},
{ 'D29','I',0,0,38,'S',2,1,0,14,11,'E'},
{ 'D30','I',0,0,37,'S',2,1,0,15,12,'E'},
{ 'D31','I',0,0,10,'S',7,1,0,221,34,'E'},
{ 'D32','I',1,0,12,'S',16,0,2,217,26,'E'},
{ 'D33','I',1,0,14,'S',16,0,2,226,0,'E'},
{ 'D34','I',1,0,13,'S',16,0,2,227,0,'E'},
{ 'D35','I',0,0,9,'S',6,1,0,222,35,'E'},
{ 'D36','I',0,0,34,'S',10,2,0,228,0,'E'},
{ 'D37','I',0,0,8,'S',16,0,2,224,36,'E'},
{ 'D38','I',0,0,55,'S',16,0,2,229,41,'E'},
{ 'D39','I',0,0,20,'S',16,0,2,237,57,'E'},
{ 'D40','I',0,0,3,'S',16,0,2,230,42,'E'},
{ 'D41','I',0,0,36,'S',16,0,2,231,43,'E'},
{ 'D42','I',0,0,21,'S',11,0,1,0,0,'E'},
{ 'D43','I',0,0,21,'S',11,0,1,0,0,'E'},
{ 'D50','B',1,3,0,'D',0,3,3,0,0,'E'},
{ 'D51','B',1,2,0,'D',0,3,3,0,0,'E'},
{ 'D52','B',1,1,0,'D',0,3,3,0,0,'E'},
{ 'D53','B',1,0,0,'D',0,3,3,0,0,'E'},
{ 'D54','I',0,0,30,'D',8,0,3,306,0,'0>0>'},
{ 'D55','I',0,0,5,'D',1,0,3,307,4,'0>0>'},
{ 'D56','I',0,0,48,'S',15,2,2,206,0,'E'},
{ 'D57','I',0,0,4,'S',16,0,2,204,3,'E'},
{ 'D66','B',3,0,0,'D',0,3,3,0,0,'E'},
{ 'D67','B',3,0,0,'D',0,3,3,0,0,'E'},
{ 'D68','B',1,0,2,'D',4,0,3,312,1,'E'},
{ 'D69','B',1,1,1,'D',4,0,3,312,1,'E'},
};
struct ios_a out_a[COUTP] =
{
{ 'D2','O',1,4,24,'S',0,3,0,25,0,'E'},
{ 'D3','O',1,3,25,'S',0,3,0,25,0,'E'},
{ 'D4','O',1,2,26,'S',0,3,0,25,0,'E'},
{ 'D5','O',1,1,27,'S',0,3,0,25,0,'E'},
{ 'D6','O',1,0,23,'S',0,3,0,205,2,'E'},
{ 'D7','O',0,0,53,'S',0,3,1,0,0,'E'},
{ 'D8','O',0,0,57,'S',0,3,1,0,0,'E'},
{ 'D9','O',0,0,49,'S',0,3,1,0,0,'E'},
{ 'D10','O',0,0,50,'S',0,3,1,0,0,'E'},
{ 'D11','O',0,0,51,'S',0,3,1,0,0,'E'},
{ 'D12','O',0,0,52,'S',0,3,1,0,0,'E'},
{ 'D13','O',0,0,54,'S',0,3,1,0,0,'E'},
{ 'D60','O',3,0,0,'S',0,3,3,0,0,'E'},
{ 'D61','O',3,0,47,'S',0,3,0,61,21,'E'},
{ 'D62','O',0,0,7,'S',0,3,0,225,37,'E'},
{ 'D63','O',0,0,56,'S',0,3,0,229,41,'E'},
{ 'D64','O',0,0,46,'S',0,3,0,59,0,'E'},
{ 'D65','O',0,0,45,'S',0,3,0,60,0,'E'},
};
struct ios_a sfty_a[CSFTY] =
{{ 'D44','S',0,0,15,'S',12,0,1,0,0,'E'},
{ 'D45','S',0,0,43,'S',12,0,1,0,0,'E'},
{ 'D46','S',0,0,15,'S',13,0,1,0,0,'E'},
{ 'D47','S',0,0,44,'S',13,0,1,0,0,'E'},
{ 'D48','S',0,0,39,'S',9,0,1,0,0,'E'},
{ 'D49','S',0,0,11,'S',9,0,1,0,0,'E'},
};
struct S_MS
{
int FREQ;
int ABSENCV;
};
//OPENING SPEEDS
struct S_MS OS[NOOS] =
{
{ 30, 0},
{ 40, 0},
{ 40, 0},
{ 45, 0},
{ 30, 0},
{ 0, 0},
};
//CLOSING SPEEDS
struct S_MS CS[NOCS] =
{
{ 30, 0},
{ 40, 0},
{ 40, 0},
{ 45, 0},
{ 30, 0},
{ 0, 0},
};
//PARTIAL OPENING SPEEDS
struct S_MS OPS[NOPS] =
{
{ 30, 0},
{ 40, 0},
{ 30, 0},
{ 0, 0},
};
//PARTIAL CLOSING SPEEDS
struct S_MS CPS[NOPS] =
{
{ 30, 0},
{ 40, 0},
{ 30, 0},
{ 0, 0},
};
// SPEED FRPM PARTIAL OPEN POSITION TO OPEN POSITION
struct S_MS PTOOS[NOPTOOS] =
{
{ 30, 0},
{ 30, 0},
{ 0, 0},
};
struct xd {
char fld[10];
};
bool * varpointbool[69] = {
&ABS
,&MBRK
,&MBRKS
,&MTMPS
,&MBRKTMPS
,&MTHPP
,&VFD
,&V37
,&MLSR
,&MLSP
,&MLSPLOP
,&MLSPLCP
,&MLSPLPP
,&MLSPLOS
,&MLSPLCS
,&MLSPLPS
,&MCSP
,&MPLP
,&OLS
,&CLS
,&PLS
,&POA
,&OTC
,&OTO
,&MA
,&ILCK
,&CAOC
,&CACC
,&CASC
,&CAC
,&CILCK
,&BPS
,&SO
,&FMP
,&ELDP
,&DOLCKSP
,&DOLCKBP
,&TAOP
,&DMNMA
,&DIROK
,&WDP
,&MOSP
,&PLCK
,&STEPRM
,&BTP
,ÐP
,&WIFIP
,&WIFIA
,&APOS
,&CAMP
,&SDP
,&USBP
,&RDOP
,&FPSP
,&RFIDP
,&DSPP
,&MENSP
,&linkok
,&DOP
,&DCL
,&DPL
,&seccomp
,&WRNL
,&CTSYL
,&TLGI
,&TLGO
,&TLRI
,&TLRO
,&WRNS
};
/* none of the char variables have been used dynamically in pinmap table 08 Apr 2023
char *varpointchar[23]={
&FWV
, &DT
, &MT
, &MCT
, &MPF
, &MPW
, &MFC
, &MDW
, &MSL
, &MDL
, &MMN
, &MDT
, &ABST
, &MBRKT
, &MBRKCT
, &VFDT
, &CDS
, &CA
, &ATBT
, &PUA
, &MDOOBTN
, &RDPT
, &fncname
};
*/
int *varpointint[40]={
&MPC
,&MFQ
,&MBRKTG
,&MBRKSS
,&MBRKIS
,&MTHPS
,&MOP
,&MCL
,&MPLS
,&NOOS
,&NOCS
,&NOPS
,&NOPTOOS
,&CMFQ
,&CMOSCTR
,&CMCSCTR
,&ILCKS
,&ACA
,&ATBTNUM
,&TCT
,&FMA
,&ELDS
,&ESA
,&DOLCKS
,&DOLCK
,&ILCKODO
,&ILCKODC
,&DMDNA
,&WDC
,&MOM
,&PLCKS
,&CINP
,&COUTP
,&CIOP
,&CSFTY
,&CGRP
,&MENSS
,&xi
,&exenum
,&fncount
};
long * varpointlong[19]={
&MOV
,&MXC
,&MGL
,&MBRKV
,&MBRKC
,&MTMPRD
,&MBRKTMPRD
,&MTHPT
,&ABSOL
,&ABSCL
,&ABSPL
,&CDPFC
,&CDPFO
,&NCOSAT
,&NCCSAT
,&OSDTRC
,&OSDTRO
,&OSSECTRC
,&OSSECTRO
};
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// writing vars to eeprom
if (varwritten == false)
{
int eeAddress = 100;
EEPROM.put(eeAddress,ABS);
eeAddress += sizeof(ABS);
EEPROM.put(eeAddress,MBRK);
eeAddress += sizeof(MBRK);
EEPROM.put(eeAddress,MBRKS);
eeAddress += sizeof(MBRKS);
EEPROM.put(eeAddress,MTMPS);
eeAddress += sizeof(MTMPS);
EEPROM.put(eeAddress,MBRKTMPS);
eeAddress += sizeof(MBRKTMPS);
EEPROM.put(eeAddress,MTHPP);
eeAddress += sizeof(MTHPP);
EEPROM.put(eeAddress,VFD);
eeAddress += sizeof(VFD);
EEPROM.put(eeAddress,V37);
eeAddress += sizeof(V37);
EEPROM.put(eeAddress,MLSR);
eeAddress += sizeof(MLSR);
EEPROM.put(eeAddress,MLSP);
eeAddress += sizeof(MLSP);
EEPROM.put(eeAddress,MLSPLOP);
eeAddress += sizeof(MLSPLOP);
EEPROM.put(eeAddress,MLSPLCP);
eeAddress += sizeof(MLSPLCP);
EEPROM.put(eeAddress,MLSPLPP);
eeAddress += sizeof(MLSPLPP);
EEPROM.put(eeAddress,MLSPLOS);
eeAddress += sizeof(MLSPLOS);
EEPROM.put(eeAddress,MLSPLCS);
eeAddress += sizeof(MLSPLCS);
EEPROM.put(eeAddress,MLSPLPS);
eeAddress += sizeof(MLSPLPS);
EEPROM.put(eeAddress,MCSP);
eeAddress += sizeof(MCSP);
EEPROM.put(eeAddress,MPLP);
eeAddress += sizeof(MPLP);
EEPROM.put(eeAddress,OLS);
eeAddress += sizeof(OLS);
EEPROM.put(eeAddress,CLS);
eeAddress += sizeof(CLS);
EEPROM.put(eeAddress,PLS);
eeAddress += sizeof(PLS);
EEPROM.put(eeAddress,POA);
eeAddress += sizeof(POA);
EEPROM.put(eeAddress,OTC);
eeAddress += sizeof(OTC);
EEPROM.put(eeAddress,OTO);
eeAddress += sizeof(OTO);
EEPROM.put(eeAddress,MA);
eeAddress += sizeof(MA);
EEPROM.put(eeAddress,ILCK);
eeAddress += sizeof(ILCK);
EEPROM.put(eeAddress,CAOC);
eeAddress += sizeof(CAOC);
EEPROM.put(eeAddress,CACC);
eeAddress += sizeof(CACC);
EEPROM.put(eeAddress,CASC);
eeAddress += sizeof(CASC);
EEPROM.put(eeAddress,CAC);
eeAddress += sizeof(CAC);
EEPROM.put(eeAddress,CILCK);
eeAddress += sizeof(CILCK);
EEPROM.put(eeAddress,BPS);
eeAddress += sizeof(BPS);
EEPROM.put(eeAddress,SO);
eeAddress += sizeof(SO);
EEPROM.put(eeAddress,FMP);
eeAddress += sizeof(FMP);
EEPROM.put(eeAddress,ELDP);
eeAddress += sizeof(ELDP);
EEPROM.put(eeAddress,DOLCKSP);
eeAddress += sizeof(DOLCKSP);
EEPROM.put(eeAddress,DOLCKBP);
eeAddress += sizeof(DOLCKBP);
EEPROM.put(eeAddress,TAOP);
eeAddress += sizeof(TAOP);
EEPROM.put(eeAddress,DMNMA);
eeAddress += sizeof(DMNMA);
EEPROM.put(eeAddress,DIROK);
eeAddress += sizeof(DIROK);
EEPROM.put(eeAddress,WDP);
eeAddress += sizeof(WDP);
EEPROM.put(eeAddress,MOSP);
eeAddress += sizeof(MOSP);
EEPROM.put(eeAddress,PLCK);
eeAddress += sizeof(PLCK);
EEPROM.put(eeAddress,STEPRM);
eeAddress += sizeof(STEPRM);
EEPROM.put(eeAddress,BTP);
eeAddress += sizeof(BTP);
EEPROM.put(eeAddress,ETHP);
eeAddress += sizeof(ETHP);
EEPROM.put(eeAddress,WIFIP);
eeAddress += sizeof(WIFIP);
EEPROM.put(eeAddress,WIFIA);
eeAddress += sizeof(WIFIA);
EEPROM.put(eeAddress,APOS);
eeAddress += sizeof(APOS);
EEPROM.put(eeAddress,CAMP);
eeAddress += sizeof(CAMP);
EEPROM.put(eeAddress,SDP);
eeAddress += sizeof(SDP);
EEPROM.put(eeAddress,USBP);
eeAddress += sizeof(USBP);
EEPROM.put(eeAddress,RDOP);
eeAddress += sizeof(RDOP);
EEPROM.put(eeAddress,FPSP);
eeAddress += sizeof(FPSP);
EEPROM.put(eeAddress,RFIDP);
eeAddress += sizeof(RFIDP);
EEPROM.put(eeAddress,DSPP);
eeAddress += sizeof(DSPP);
EEPROM.put(eeAddress,MENSP);
eeAddress += sizeof(MENSP);
EEPROM.put(eeAddress,linkok);
eeAddress += sizeof(linkok);
EEPROM.put(eeAddress,DOP);
eeAddress += sizeof(DOP);
EEPROM.put(eeAddress,DCL);
eeAddress += sizeof(DCL);
EEPROM.put(eeAddress,DPL);
eeAddress += sizeof(DPL);
EEPROM.put(eeAddress,seccomp);
eeAddress += sizeof(seccomp);
EEPROM.put(eeAddress,WRNL);
eeAddress += sizeof(WRNL);
EEPROM.put(eeAddress,CTSYL);
eeAddress += sizeof(CTSYL);
EEPROM.put(eeAddress,TLGI);
eeAddress += sizeof(TLGI);
EEPROM.put(eeAddress,TLGO);
eeAddress += sizeof(TLGO);
EEPROM.put(eeAddress,TLRI);
eeAddress += sizeof(TLRI);
EEPROM.put(eeAddress,TLRO);
eeAddress += sizeof(TLRO);
EEPROM.put(eeAddress,WRNS);
eeAddress += sizeof(WRNS);
EEPROM.put(eeAddress,FWV);
eeAddress += sizeof(FWV);
EEPROM.put(eeAddress,DT);
eeAddress += sizeof(DT);
EEPROM.put(eeAddress,MT);
eeAddress += sizeof(MT);
EEPROM.put(eeAddress,MCT);
eeAddress += sizeof(MCT);
EEPROM.put(eeAddress,MPF);
eeAddress += sizeof(MPF);
EEPROM.put(eeAddress,MPW);
eeAddress += sizeof(MPW);
EEPROM.put(eeAddress,MFC);
eeAddress += sizeof(MFC);
EEPROM.put(eeAddress,MDW);
eeAddress += sizeof(MDW);
EEPROM.put(eeAddress,MSL);
eeAddress += sizeof(MSL);
EEPROM.put(eeAddress,MDL);
eeAddress += sizeof(MDL);
EEPROM.put(eeAddress,MMN);
eeAddress += sizeof(MMN);
EEPROM.put(eeAddress,MDT);
eeAddress += sizeof(MDT);
EEPROM.put(eeAddress,ABST);
eeAddress += sizeof(ABST);
EEPROM.put(eeAddress,MBRKT);
eeAddress += sizeof(MBRKT);
EEPROM.put(eeAddress,MBRKCT);
eeAddress += sizeof(MBRKCT);
EEPROM.put(eeAddress,VFDT);
eeAddress += sizeof(VFDT);
EEPROM.put(eeAddress,CDS);
eeAddress += sizeof(CDS);
EEPROM.put(eeAddress,CA);
eeAddress += sizeof(CA);
EEPROM.put(eeAddress,ATBT);
eeAddress += sizeof(ATBT);
EEPROM.put(eeAddress,PUA);
eeAddress += sizeof(PUA);
EEPROM.put(eeAddress,MDOOBTN);
eeAddress += sizeof(MDOOBTN);
EEPROM.put(eeAddress,RDPT);
eeAddress += sizeof(RDPT);
EEPROM.put(eeAddress,fncname);
eeAddress += sizeof(fncname);
EEPROM.put(eeAddress,MPC);
eeAddress += sizeof(MPC);
EEPROM.put(eeAddress,MFQ);
eeAddress += sizeof(MFQ);
EEPROM.put(eeAddress,MBRKTG);
eeAddress += sizeof(MBRKTG);
EEPROM.put(eeAddress,MBRKSS);
eeAddress += sizeof(MBRKSS);
EEPROM.put(eeAddress,MBRKIS);
eeAddress += sizeof(MBRKIS);
EEPROM.put(eeAddress,MTHPS);
eeAddress += sizeof(MTHPS);
EEPROM.put(eeAddress,MOP);
eeAddress += sizeof(MOP);
EEPROM.put(eeAddress,MCL);
eeAddress += sizeof(MCL);
EEPROM.put(eeAddress,MPLS);
eeAddress += sizeof(MPLS);
EEPROM.put(eeAddress,NOOS);
eeAddress += sizeof(NOOS);
EEPROM.put(eeAddress,NOCS);
eeAddress += sizeof(NOCS);
EEPROM.put(eeAddress,NOPS);
eeAddress += sizeof(NOPS);
EEPROM.put(eeAddress,NOPTOOS);
eeAddress += sizeof(NOPTOOS);
EEPROM.put(eeAddress,CMFQ);
eeAddress += sizeof(CMFQ);
EEPROM.put(eeAddress,CMOSCTR);
eeAddress += sizeof(CMOSCTR);
EEPROM.put(eeAddress,CMCSCTR);
eeAddress += sizeof(CMCSCTR);
EEPROM.put(eeAddress,ILCKS);
eeAddress += sizeof(ILCKS);
EEPROM.put(eeAddress,ACA);
eeAddress += sizeof(ACA);
EEPROM.put(eeAddress,ATBTNUM);
eeAddress += sizeof(ATBTNUM);
EEPROM.put(eeAddress,TCT);
eeAddress += sizeof(TCT);
EEPROM.put(eeAddress,FMA);
eeAddress += sizeof(FMA);
EEPROM.put(eeAddress,ELDS);
eeAddress += sizeof(ELDS);
EEPROM.put(eeAddress,ESA);
eeAddress += sizeof(ESA);
EEPROM.put(eeAddress,DOLCKS);
eeAddress += sizeof(DOLCKS);
EEPROM.put(eeAddress,DOLCK);
eeAddress += sizeof(DOLCK);
EEPROM.put(eeAddress,ILCKODO);
eeAddress += sizeof(ILCKODO);
EEPROM.put(eeAddress,ILCKODC);
eeAddress += sizeof(ILCKODC);
EEPROM.put(eeAddress,DMDNA);
eeAddress += sizeof(DMDNA);
EEPROM.put(eeAddress,WDC);
eeAddress += sizeof(WDC);
EEPROM.put(eeAddress,MOM);
eeAddress += sizeof(MOM);
EEPROM.put(eeAddress,PLCKS);
eeAddress += sizeof(PLCKS);
EEPROM.put(eeAddress,CINP);
eeAddress += sizeof(CINP);
EEPROM.put(eeAddress,COUTP);
eeAddress += sizeof(COUTP);
EEPROM.put(eeAddress,CIOP);
eeAddress += sizeof(CIOP);
EEPROM.put(eeAddress,CSFTY);
eeAddress += sizeof(CSFTY);
EEPROM.put(eeAddress,CGRP);
eeAddress += sizeof(CGRP);
EEPROM.put(eeAddress,MENSS);
eeAddress += sizeof(MENSS);
EEPROM.put(eeAddress,xi);
eeAddress += sizeof(xi);
EEPROM.put(eeAddress,exenum);
eeAddress += sizeof(exenum);
EEPROM.put(eeAddress,fncount);
eeAddress += sizeof(fncount);
EEPROM.put(eeAddress,MOV);
eeAddress += sizeof(MOV);
EEPROM.put(eeAddress,MXC);
eeAddress += sizeof(MXC);
EEPROM.put(eeAddress,MGL);
eeAddress += sizeof(MGL);
EEPROM.put(eeAddress,MBRKV);
eeAddress += sizeof(MBRKV);
EEPROM.put(eeAddress,MBRKC);
eeAddress += sizeof(MBRKC);
EEPROM.put(eeAddress,MTMPRD);
eeAddress += sizeof(MTMPRD);
EEPROM.put(eeAddress,MBRKTMPRD);
eeAddress += sizeof(MBRKTMPRD);
EEPROM.put(eeAddress,MTHPT);
eeAddress += sizeof(MTHPT);
EEPROM.put(eeAddress,ABSOL);
eeAddress += sizeof(ABSOL);
EEPROM.put(eeAddress,ABSCL);
eeAddress += sizeof(ABSCL);
EEPROM.put(eeAddress,ABSPL);
eeAddress += sizeof(ABSPL);
EEPROM.put(eeAddress,CDPFC);
eeAddress += sizeof(CDPFC);
EEPROM.put(eeAddress,CDPFO);
eeAddress += sizeof(CDPFO);
EEPROM.put(eeAddress,NCOSAT);
eeAddress += sizeof(NCOSAT);
EEPROM.put(eeAddress,NCCSAT);
eeAddress += sizeof(NCCSAT);
EEPROM.put(eeAddress,OSDTRC);
eeAddress += sizeof(OSDTRC);
EEPROM.put(eeAddress,OSDTRO);
eeAddress += sizeof(OSDTRO);
EEPROM.put(eeAddress,OSSECTRC);
eeAddress += sizeof(OSSECTRC);
EEPROM.put(eeAddress,OSSECTRO);
eeAddress += sizeof(OSSECTRO);
Serial.print(" var written ");
Serial.println(eeAddress);
delay(5000);
varwritten = true;
}
else
{
Serial.println(" var pre written ");
}
// put your main code here, to run repeatedly:
if (arraywritten == false)
{
int eeAddress = 1636;
EEPROM.put(eeAddress,in_a);
eeAddress += sizeof(in_a);
EEPROM.put(eeAddress,out_a);
eeAddress += sizeof(out_a);
EEPROM.put(eeAddress,sfty_a);
eeAddress += sizeof(sfty_a);
EEPROM.put(eeAddress,OS);
eeAddress += sizeof(OS);
EEPROM.put(eeAddress,CS);
eeAddress += sizeof(CS);
EEPROM.put(eeAddress,OPS);
eeAddress += sizeof(OPS);
EEPROM.put(eeAddress,CPS);
eeAddress += sizeof(CPS);
EEPROM.put(eeAddress,PTOOS);
eeAddress += sizeof(PTOOS);
arraywritten = true;
}
else
{SIZEOFVARS = 0;
Serial.println("input array ");
Serial.println(sizeof(in_a));
Serial.println("output array ");
Serial.println(sizeof(out_a));
Serial.println("safety array ");
Serial.println(sizeof(sfty_a));
Serial.println(sizeof(OS));
Serial.println(sizeof(CS));
Serial.println(sizeof(OPS));
Serial.println(sizeof(CPS));
Serial.println(sizeof(PTOOS));
delay(1000);}
}