Blinky

Introduction

Turn on and off the light pin to create a blinking effect.

A breadboard with a blinking LED

forever(function() {

})

Step 1

Add a ||pins:digital write|| to turn the D0 pin LOW.

forever(function() {
    pins.D0.digitalWrite(false)
})

Step 2

Take a peek at the simulator and make sure the LED is turned off.

A breadboard with a LED turned off

Step 3

Add another ||blocks:pause|| and ||pins:digital write|| to create a blinking effect. Make sure the digital write is HIGH.

forever(function() {
    pins.D0.digitalWrite(false)
    pause(500)
    pins.D0.digitalWrite(true)
    pause(500)    
})

Play with the duration in your pauses to create different patterns.

Step 4

Look at the simulator and make sure your program works as expected.

If you have a board, press |Download| and follow the instruction to get your code on your device.

Click on the wrench icon under the simulator to get detailed breadboarding instructions.

The wrench button

feature=uf2
feature=pind0