-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
autoformatter[bot]
committed
Oct 16, 2024
1 parent
573eee9
commit 01b21c4
Showing
2 changed files
with
43 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,31 @@ | ||
// pico code to test watchdog, flatlines after 50 iterations, resets around 100 iterations | ||
// pico code to test watchdog, flatlines after 50 iterations, resets around 100 | ||
// iterations | ||
#define h1 14 | ||
#define h2 15 | ||
|
||
// the setup function runs once when you press reset or power the board | ||
void setup() { | ||
// initialize digital pin LED_BUILTIN as an output. | ||
pinMode(LED_BUILTIN, OUTPUT); | ||
pinMode(h1, OUTPUT); | ||
pinMode(h2, OUTPUT); | ||
pinMode(h1, OUTPUT); | ||
pinMode(h2, OUTPUT); | ||
} | ||
|
||
int i = 0; | ||
int i = 0; | ||
// the loop function runs over and over again forever | ||
void loop() { | ||
Serial.println(i++); | ||
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level) | ||
delay(250); // wait for a second | ||
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW | ||
delay(250); | ||
Serial.println(i++); | ||
digitalWrite(LED_BUILTIN, | ||
HIGH); // turn the LED on (HIGH is the voltage level) | ||
delay(250); // wait for a second | ||
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW | ||
delay(250); | ||
|
||
if(i < 80){ | ||
digitalWrite(h1, (i & 0x1)); | ||
digitalWrite(h2, (i & 0x1)); | ||
if (i < 80) { | ||
digitalWrite(h1, (i & 0x1)); | ||
digitalWrite(h2, (i & 0x1)); | ||
} | ||
if(i == 50){ | ||
Serial.println("Flatline"); | ||
if (i == 50) { | ||
Serial.println("Flatline"); | ||
} | ||
} |