improve it
This commit is contained in:
parent
e3dcd77744
commit
6a02c2f8cd
4 changed files with 181 additions and 118 deletions
8
train.h
8
train.h
|
|
@ -17,6 +17,8 @@ public:
|
|||
|
||||
private:
|
||||
uint8_t _address;
|
||||
uint8_t _function = 0;
|
||||
uint8_t _speed = 0;
|
||||
|
||||
static const unsigned char _pinHighA = PD5;
|
||||
static const unsigned char _pinLowA = PD4;
|
||||
|
|
@ -28,10 +30,12 @@ private:
|
|||
uint8_t _protocol = M_DIGITAL;
|
||||
|
||||
uint16_t lastDataPacket = 0;
|
||||
|
||||
int8_t functionTimer = -1;
|
||||
|
||||
inline static void off();
|
||||
void sendBit(const bool bit);
|
||||
void sendAddress();
|
||||
void functionClear();
|
||||
|
||||
public:
|
||||
|
||||
|
|
@ -56,6 +60,8 @@ public:
|
|||
|
||||
void setSpeed(uint8_t speed);
|
||||
|
||||
uint8_t getSpeed();
|
||||
|
||||
void setProtocol(const uint8_t protocol);
|
||||
|
||||
void setAddress(const uint8_t address);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue