Skip to content

Commit

Permalink
Change 10 seconds to 5 seconds.
Browse files Browse the repository at this point in the history
  • Loading branch information
kentlouisetonino committed Apr 9, 2024
1 parent b3072ed commit 2634dde
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#include <util/delay.h>

int main(void) {
double delay5s = 5000;
double delay500ms = 500;
int blinkCount = 1;

// PORTD: Maps to Arduino digital pins 0 to 7.
Expand All @@ -15,13 +17,13 @@ int main(void) {

if (blinkCount == 10) {
// Turn on the light for 5 seconds.
_delay_ms(5000);
_delay_ms(delay5s);

// Reset the state of blink count.
blinkCount = 1;
} else {
// Turn the light for 500 milliseconds.
_delay_ms(500);
_delay_ms(delay500ms);

// Increment the blink count state.
blinkCount += 1;
Expand All @@ -31,7 +33,7 @@ int main(void) {
PORTD &= ~(1 << PORTD3);

// Turn off the LED for 500 milliseconds.
_delay_ms(500);
_delay_ms(delay500ms);
}

return 0;
Expand Down

0 comments on commit 2634dde

Please sign in to comment.