Skip to content

Commit

Permalink
can also control pin 12
Browse files Browse the repository at this point in the history
  • Loading branch information
drandyhaas committed May 24, 2024
1 parent 24d3291 commit d527bfa
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions software/serial_rebooter/serial_rebooter.ino
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 7,10 @@ Processor: ATmega168
void setup() {
pinMode(LED_BUILTIN, OUTPUT); // pin 13
digitalWrite(LED_BUILTIN,HIGH);

pinMode(12, OUTPUT); // pin 12
digitalWrite(12,HIGH);

Serial.begin(9600);
Serial.println("Arduino Connected");
}
Expand All @@ -17,6 21,7 @@ void loop() {
if(Serial.available()){
input = Serial.readStringUntil('\n');
Serial.println("Read: " input);

if(input.substring(0, 10) == "haasoscope") {
if (input.substring(11,13) == "on") {
Serial.println("on");
Expand All @@ -27,5 32,27 @@ void loop() {
digitalWrite(LED_BUILTIN,LOW);
}
}

if(input.substring(0, 10) == "arduino_13") {
if (input.substring(11,13) == "on") {
Serial.println("on");
digitalWrite(13,HIGH);
}
else if (input.substring(11,14) == "off"){
Serial.println("off");
digitalWrite(13,LOW);
}
}

if(input.substring(0, 10) == "arduino_12") {
if (input.substring(11,13) == "on") {
Serial.println("on");
digitalWrite(12,HIGH);
}
else if (input.substring(11,14) == "off"){
Serial.println("off");
digitalWrite(12,LOW);
}
}
}
}

0 comments on commit d527bfa

Please sign in to comment.