Blink

Intro :

One of the first sketches you encounter when working with Arduino is turning an LED on and off

In this example there is a Functional Error in the code which successfully compiles but results in an unexpected behaviour from the LED. Try decifer where the issue arises.

---------------------------------------------------------------------------->

Blinking LED :

Pins

    LED = D13
---------------------------------------------------------------------------->

Feedback Shield :

If you have a feedback shield place it on top of your Arduino board and view what visual feedback you get when you make changes to your code.

What are the LEDs doing and what colour are they?

In this example ...

    Why is the shield on the left showing a static off or static on LED?
    Or why might the LED be flickering?
    How would you adapt the code to get the righ hand output?

More information on the Feedback Shield can be found here

---------------------------------------------------------------------------->

Try it :

Try edit the code to turn the flickering or static LED into a stable blinking LED. Consider what line of code might need to be added to create the visual difference.

Copy the Function Error code below into your Arduino IDE and begin editing it. Once you think you have solved the Functional Error upload to your board to see the visual difference. Remember to check the board and port match your Arduino board and USB port in use.

You can also experiment with your code edits using the embedded TinkerCAD circuit above. Click on the TinkerCAD icon to open the dashboard in a seperate tab. Then press the code button to edit the blockly or text-based code. Press start simulation to see the changes in action.

---------------------------------------------------------------------------->

J3n Sykes

GitHub | Back to examples