Embedded Programming

This week involves programming a board to do something. Given that I already had a board from week 4 with a button and an LED, I decided to use that to make the LED blink when the button is pressed. Since the board is currently programmed to detect when the button is pressed, all that needs to be modified is the when the LED turns on and off. To review, we can write a value to an LED with the digitalWrite() command, passing in either HIGH or LOW to the appropriate LED pin. Then, we can use the delay() function to pause the program before writing a new value to the LED. This command reads input in milliseconds, which means that "delay(1000)" pauses the program for 1 second. An important note on the delay() function is that it completely pauses the entire program, which means that no other processes can execute. This is usually okay depending on the desired logic of the program, but is just an important fact to keep in mind. Finally, after changing the program we can see the following results (the different blink speeds are due to different delay values):

Link to index page