-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTPL.cpp
More file actions
29 lines (26 loc) · 836 Bytes
/
TPL.cpp
File metadata and controls
29 lines (26 loc) · 836 Bytes
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
#include <Arduino.h>
#include "TPL.h"
#include "TPL2.h"
#include "TPLSensor.h"
#include <Turnouts.h>
void TPL::begin(
short signalZeroPin, // arduino pin connected to first signal
short signals // Number of signals (2 pins each)
) {
TPL2::begin( signalZeroPin, signals);
}
void TPL::loop() {
TPL2::loop();
}
void TPL::I2CTURNOUT(byte id, byte pin, int servoLeft, int servoRight) {
Turnout::create(id, pin, servoLeft, servoRight);
}
void TPL::DCCTURNOUT(byte id, int dccAddress, byte subAddress, bool activatedIsLeft) {
Turnout::create(id, dccAddress, subAddress, activatedIsLeft);
}
void TPL::I2CSENSOR(byte id, byte pin) {
new TPLSensor(id, true, pin);
}
void TPL::PINSENSOR(byte id, byte pin) {
new TPLSensor(id, false, pin);
}