TMCStepper
SERIAL_SWITCH.cpp
Go to the documentation of this file.
1 #include "SERIAL_SWITCH.h"
2 
3 SSwitch::SSwitch( const uint16_t pin1, const uint16_t pin2, const uint8_t address) :
4  p1(pin1),
5  p2(pin2),
6  addr(address)
7  {
8  pinMode(pin1, OUTPUT);
9  pinMode(pin2, OUTPUT);
10  }
11 
13  digitalWrite(p1, addr & 0b01 ? HIGH : LOW);
14  digitalWrite(p2, addr & 0b10 ? HIGH : LOW);
15 }
SSwitch::SSwitch
SSwitch(const uint16_t pin1, const uint16_t pin2, const uint8_t address)
Definition: SERIAL_SWITCH.cpp:3
SSwitch::active
void active()
Definition: SERIAL_SWITCH.cpp:12
SERIAL_SWITCH.h