DenScript Lesson 1: Blink

What do you need?

Wiring:

  1. Connect the DenScript Arduino Uno Shield onto the Arduino Uno or other Arduino Board.
  2. Connect one end of the DenScript Digital Wire to the DenScript LED, ensuring the colours are matched correctly.
  3. Connect the other end of the DenScript Digital Wire to the DenScript Arduino Uno Shield, at Pin 13. Ensure the colours are matched correctly.
  4. Connect the Arduino board to your computer via the USB cable.

Programming:

Next, upload this code to your Arduino.

This code will cause the LED to toggle its state once a second.

Lets go through this code one bit at a time.

‘ int led = 13 ‘: will assign the integer value of 13 to the variable ‘led’.

In the ‘setup()’ function, we set the led pin to the output state.

Finally, in the ‘loop()’ function, we set the led pin HIGH (which means on), delay by 1000 milliseconds (1 second), set the led pin LOW (which means off), and then delay another 1000 milliseconds. As this all happens in the ‘loop()’ function, it repeats indefinitely.

Leave a Reply

Your email address will not be published.