nicer formatting
parent
221e01033e
commit
9cc0955003
|
@ -32,9 +32,9 @@ uint8_t getMode(uint8_t pin){
|
|||
|
||||
uint8_t toggleState(uint8_t pin){
|
||||
uint8_t mode = getMode(pin);
|
||||
switch (mode){
|
||||
switch (mode) {
|
||||
case OUTPUT:
|
||||
if (digitalRead(pin) == HIGH){
|
||||
if (digitalRead(pin) == HIGH) {
|
||||
digitalWrite(pin, LOW);
|
||||
return LOW;
|
||||
} else {
|
||||
|
@ -56,7 +56,7 @@ uint8_t toogleMode(uint8_t pin){
|
|||
uint8_t mode = getMode(pin);
|
||||
// declared here bc it won’t let me inside the switch/case statement
|
||||
uint8_t state;
|
||||
switch (mode){
|
||||
switch (mode) {
|
||||
case OUTPUT:
|
||||
state = digitalRead(pin);
|
||||
pinMode(pin, INPUT);
|
||||
|
@ -84,14 +84,14 @@ uint8_t toogleMode(uint8_t pin){
|
|||
void setup(){
|
||||
Serial.begin(115200);
|
||||
// set all pins to input and low
|
||||
for (uint8_t i; i<NUM_DIGITAL_PINS; i++){
|
||||
for (uint8_t i; i<NUM_DIGITAL_PINS; i++) {
|
||||
Serial.print(".");
|
||||
if (i==TX_PIN || i==RX_PIN);
|
||||
else pinMode(i, INPUT);
|
||||
}
|
||||
Serial.print(".");
|
||||
pinMode(LED_BUILTIN, OUTPUT); // set LED to output bc having it as an input would make little sense
|
||||
while (Serial.available() > 0){
|
||||
while (Serial.available() > 0) {
|
||||
Serial.print(".");
|
||||
Serial.read();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue