-
Notifications
You must be signed in to change notification settings - Fork 0
/
TPL.ino
49 lines (36 loc) · 1.13 KB
/
TPL.ino
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
#include "TPL.h"
#include <DCCEXParser.h>
#include <WifiInterface.h>
#include <freeMemory.h>
int minMemory;
// Create a serial command parser... This is OPTIONAL if you don't need to handle JMRI type commands
// from the Serial port.
DCCEXParser serialParser;
void printmemory() {
Serial.print(F("\nFREEMEM="));
Serial.println(minMemory);
}
#include "myRoutes.h"
void setup(){
DIAGSERIAL.begin(115200); // for diagnostics
Serial1.begin(115200);
WifiInterface::setup(Serial1, F("BTHub5-M6PT"), F("49de8d4862"),F("DCCEX"),F("TPL"),3532); // (3532 is 0xDCC decimal... )
#include "myLayout.h"
TPL::begin(
22, // Obsolete... parameters Arduino pin for signal zero
0); // Number of contiguous signals (2 pins each)
minMemory=freeMemory();
printmemory();
}
void loop() {
TPL::loop();
// handle any incoming commands on USB connection
serialParser.loop(DIAGSERIAL);
// handle any incoming WiFi traffic
WifiInterface::loop(Serial1);
int thismemory=freeMemory();
if (thismemory<minMemory) {
minMemory=thismemory;
printmemory();
}
}