-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.ino
More file actions
58 lines (37 loc) · 1.23 KB
/
Copy pathmain.ino
File metadata and controls
58 lines (37 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include "IldaStreamReader.h"
#include "IldaProcessor.h"
// #include "IldaSDCardDataReader.h"
#include "IldaSerialDataReader.h"
// #include "IldaEsp32Output.h"
#include "IldaAtmega32u4BufOutput.h"
IldaProcessor * processor;
void setup()
{
//IldaSDCardDataReader * reader = new IldaSDCardDataReader();
Serial.begin(115200);
Serial.setTimeout(0);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
IldaSerialDataReader * reader = new IldaSerialDataReader(&Serial);
// IldaEsp32Output * out = new IldaEsp32Output();
IldaAtmega32u4BufOutput * out = new IldaAtmega32u4BufOutput();
IldaStreamReader * streamreader = new IldaStreamReader();
processor = new IldaProcessor(reader, out, streamreader);
processor->Init();
}
void loop()
{
int res = processor->Process();
if ((res == IldaStreamReader::ERROR_INVALID_RECORD_FORMAT) ||
((res & 0x100) > 0))
{
Serial.print("error ");
Serial.println(res);
}
// Serial.print("res ");
// Serial.print(res);
// Serial.print(", code ");
// Serial.println(processor->_code);
// delay(250);
}