/*
Name: T4SerialTest.ino
Created: 4/15/2022 12:20:28 PM
Author: Donperry
*/
#include <EEPROM.h>
#include <EEPROManything.h>
// the setup function runs once when you press reset or power the board
struct TestDatastruct {
short testTable0[22][15] = {
{0,100,100, 100, 65, 100, 100, 100, 100,100,100,100,100,100,100 },
{100,100,100, 100, 100, 75, 100, 100, 100,100,100,100,100,100,100 },
{100,100,100, 100, 100, 100, 85, 100, 100,100,100,100,100,100,100 },
{28,100,100, 100, 100, 100, 100, 95, 100,100,100,100,100,100,100 },
{100,38,100, 100, 100, 100, 100, 100, 0,100,100,100,100,100,100 },
{100,100,48, 100, 100, 100, 100, 100, 100,5,100,100,100,100,100 },
{100,100,100, 58, 100, 100, 100, 100, 100,100,15,100,100,100,100 },
{100,100,100, 100, 68, 100, 100, 100, 100,100,100,25,100,100,100 },
{100,100,100, 100, 100, 78, 100, 100, 100,100,100,100,35,100,100 },
{100,100,100, 100, 100, 100, 88, 100, 100,100,100,100,100,45,100 },
{100,100,100, 100, 100, 100, 100, 98, 100,100,100,100,100,100,55 },
{0,100,100, 100, 65, 100, 100, 100, 100,100,100,100,100,100,100 },
{100,100,100, 100, 100, 75, 100, 100, 100,100,100,100,100,100,100 },
{100,100,100, 100, 100, 100, 85, 100, 100,100,100,100,100,100,100 },
{28,100,100, 100, 100, 100, 100, 95, 100,100,100,100,100,100,100 },
{100,38,100, 100, 100, 100, 100, 100, 0,100,100,100,100,100,100 },
{100,100,48, 100, 100, 100, 100, 100, 100,5,100,100,100,100,100 },
{100,100,100, 58, 100, 100, 100, 100, 100,100,15,100,100,100,100 },
{100,100,100, 100, 68, 100, 100, 100, 100,100,100,25,100,100,100 },
{100,100,100, 100, 100, 78, 100, 100, 100,100,100,100,35,100,100 },
{100,100,100, 100, 100, 100, 88, 100, 100,100,100,100,100,45,100 },
{100,100,100, 100, 100, 100, 100, 98, 100,100,100,100,100,100,55 },
};
short testTable1[22][15] = {
{0,100,100, 100, 65, 100, 100, 100, 100,100,100,100,100,100,100 },
{100,100,100, 100, 100, 75, 100, 100, 100,100,100,100,100,100,100 },
{100,100,100, 100, 100, 100, 85, 100, 100,100,100,100,100,100,100 },
{28,100,100, 100, 100, 100, 100, 95, 100,100,100,100,100,100,100 },
{100,38,100, 100, 100, 100, 100, 100, 0,100,100,100,100,100,100 },
{100,100,48, 100, 100, 100, 100, 100, 100,5,100,100,100,100,100 },
{100,100,100, 58, 100, 100, 100, 100, 100,100,15,100,100,100,100 },
{100,100,100, 100, 68, 100, 100, 100, 100,100,100,25,100,100,100 },
{100,100,100, 100, 100, 78, 100, 100, 100,100,100,100,35,100,100 },
{100,100,100, 100, 100, 100, 88, 100, 100,100,100,100,100,45,100 },
{100,100,100, 100, 100, 100, 100, 98, 100,100,100,100,100,100,55 },
{0,100,100, 100, 65, 100, 100, 100, 100,100,100,100,100,100,100 },
{100,100,100, 100, 100, 75, 100, 100, 100,100,100,100,100,100,100 },
{100,100,100, 100, 100, 100, 85, 100, 100,100,100,100,100,100,100 },
{28,100,100, 100, 100, 100, 100, 95, 100,100,100,100,100,100,100 },
{100,38,100, 100, 100, 100, 100, 100, 0,100,100,100,100,100,100 },
{100,100,48, 100, 100, 100, 100, 100, 100,5,100,100,100,100,100 },
{100,100,100, 58, 100, 100, 100, 100, 100,100,15,100,100,100,100 },
{100,100,100, 100, 68, 100, 100, 100, 100,100,100,25,100,100,100 },
{100,100,100, 100, 100, 78, 100, 100, 100,100,100,100,35,100,100 },
{100,100,100, 100, 100, 100, 88, 100, 100,100,100,100,100,45,100 },
{100,100,100, 100, 100, 100, 100, 98, 100,100,100,100,100,100,55 },
};
short testTable2[22][15] = {
{0,100,100, 100, 65, 100, 100, 100, 100,100,100,100,100,100,100 },
{100,100,100, 100, 100, 75, 100, 100, 100,100,100,100,100,100,100 },
{100,100,100, 100, 100, 100, 85, 100, 100,100,100,100,100,100,100 },
{28,100,100, 100, 100, 100, 100, 95, 100,100,100,100,100,100,100 },
{100,38,100, 100, 100, 100, 100, 100, 0,100,100,100,100,100,100 },
{100,100,48, 100, 100, 100, 100, 100, 100,5,100,100,100,100,100 },
{100,100,100, 58, 100, 100, 100, 100, 100,100,15,100,100,100,100 },
{100,100,100, 100, 68, 100, 100, 100, 100,100,100,25,100,100,100 },
{100,100,100, 100, 100, 78, 100, 100, 100,100,100,100,35,100,100 },
{100,100,100, 100, 100, 100, 88, 100, 100,100,100,100,100,45,100 },
{100,100,100, 100, 100, 100, 100, 98, 100,100,100,100,100,100,55 },
{0,100,100, 100, 65, 100, 100, 100, 100,100,100,100,100,100,100 },
{100,100,100, 100, 100, 75, 100, 100, 100,100,100,100,100,100,100 },
{100,100,100, 100, 100, 100, 85, 100, 100,100,100,100,100,100,100 },
{28,100,100, 100, 100, 100, 100, 95, 100,100,100,100,100,100,100 },
{100,38,100, 100, 100, 100, 100, 100, 0,100,100,100,100,100,100 },
{100,100,48, 100, 100, 100, 100, 100, 100,5,100,100,100,100,100 },
{100,100,100, 58, 100, 100, 100, 100, 100,100,15,100,100,100,100 },
{100,100,100, 100, 68, 100, 100, 100, 100,100,100,25,100,100,100 },
{100,100,100, 100, 100, 78, 100, 100, 100,100,100,100,35,100,100 },
{100,100,100, 100, 100, 100, 88, 100, 100,100,100,100,100,45,100 },
{100,100,100, 100, 100, 100, 100, 98, 100,100,100,100,100,100,55 },
};
short testTable3[22][15] = {
{0,100,100, 100, 65, 100, 100, 100, 100,100,100,100,100,100,100 },
{100,100,100, 100, 100, 75, 100, 100, 100,100,100,100,100,100,100 },
{100,100,100, 100, 100, 100, 85, 100, 100,100,100,100,100,100,100 },
{28,100,100, 100, 100, 100, 100, 95, 100,100,100,100,100,100,100 },
{100,38,100, 100, 100, 100, 100, 100, 0,100,100,100,100,100,100 },
{100,100,48, 100, 100, 100, 100, 100, 100,5,100,100,100,100,100 },
{100,100,100, 58, 100, 100, 100, 100, 100,100,15,100,100,100,100 },
{100,100,100, 100, 68, 100, 100, 100, 100,100,100,25,100,100,100 },
{100,100,100, 100, 100, 78, 100, 100, 100,100,100,100,35,100,100 },
{100,100,100, 100, 100, 100, 88, 100, 100,100,100,100,100,45,100 },
{100,100,100, 100, 100, 100, 100, 98, 100,100,100,100,100,100,55 },
{0,100,100, 100, 65, 100, 100, 100, 100,100,100,100,100,100,100 },
{100,100,100, 100, 100, 75, 100, 100, 100,100,100,100,100,100,100 },
{100,100,100, 100, 100, 100, 85, 100, 100,100,100,100,100,100,100 },
{28,100,100, 100, 100, 100, 100, 95, 100,100,100,100,100,100,100 },
{100,38,100, 100, 100, 100, 100, 100, 0,100,100,100,100,100,100 },
{100,100,48, 100, 100, 100, 100, 100, 100,5,100,100,100,100,100 },
{100,100,100, 58, 100, 100, 100, 100, 100,100,15,100,100,100,100 },
{100,100,100, 100, 68, 100, 100, 100, 100,100,100,25,100,100,100 },
{100,100,100, 100, 100, 78, 100, 100, 100,100,100,100,35,100,100 },
{100,100,100, 100, 100, 100, 88, 100, 100,100,100,100,100,45,100 },
{100,100,100, 100, 100, 100, 100, 98, 100,100,100,100,100,100,55 },
};
};
TestDatastruct struc;
void setup() {
pinMode(13, OUTPUT);
Serial.begin(115200);
attachInterrupt(9, dummyHandler, CHANGE);
struc = TestDatastruct();
}
// the loop function runs over and over again until power down or reset
elapsedMicros updateCheckTimer;
void loop() {
if (updateCheckTimer > 50) //check for data every 50ms
if (Serial.available()) //then we have update to read from stream
{
noInterrupts();
updateCheckTimer = 0; //reset the counter
for (int i = 0; i < 100; i++)
{
String data = Serial.readStringUntil('|');
if (data >= 0 || data <= 10000)
{
digitalWrite(13, !digitalRead(13));
}
Serial.print("R");
//EEPROM.put(0, struc);
}
interrupts();
}
}
void dummyHandler()
{
}