2019-06-24 12:52:33 +00:00
|
|
|
#include <Arduino.h>
|
|
|
|
|
2019-06-26 14:46:07 +00:00
|
|
|
void peripheral_register(uint8_t pin_number) {
|
2019-06-24 12:52:33 +00:00
|
|
|
pinMode(OUTPUT, pin_number);
|
|
|
|
// Disable the device by default to avoid issues
|
|
|
|
digitalWrite(pin_number, HIGH);
|
|
|
|
}
|
|
|
|
|
2019-06-26 14:46:07 +00:00
|
|
|
void peripheral_unsilence(uint8_t pin_number) {
|
2019-06-24 12:52:33 +00:00
|
|
|
digitalWrite(pin_number, LOW);
|
|
|
|
}
|
|
|
|
|
2019-06-26 14:46:07 +00:00
|
|
|
void peripheral_silence(uint8_t pin_number) {
|
2019-06-24 12:52:33 +00:00
|
|
|
digitalWrite(pin_number, HIGH);
|
|
|
|
}
|
|
|
|
|
2019-06-26 14:46:07 +00:00
|
|
|
void peripheral_switch(uint8_t pin_number_old, uint8_t pin_number_new) {
|
2019-06-24 12:52:33 +00:00
|
|
|
digitalWrite(pin_number_old, HIGH);
|
|
|
|
digitalWrite(pin_number_new, LOW);
|
|
|
|
}
|