Blink in BIPES
Overview
In this lab, we will use BIPES to make the green on-board LED on the Raspberry Pi Pico blink on and off every half second. The only things you need to run this program are
- BIPES
- a USB cable
- a Raspberry Pi Pico microcontroller
Finding the Blocks
Take a look at the left navigation. Each section in the navigation contains different items that you will use to run your program. We will use blocks from Loops,
Logic,
Machine:In/Out Pins (Change the pin to LED / GPIO25),
and Timing (Change the delay time to .5) sections.
Blinking the Builtin LED
The pico has a single built in green LED wired to logical pin 25. We call this GPIO 25. GPIO means General Purpose Input and Output pin. Here is a sample program that you can use. Don't worry about understanding each block yet. We will cover the various parts in later sections.
Anything inside the green block repeats while true. Thus the program will run forever, or until we stop it. We are setting the onboard LED to true (on). The next block is a delay for 1/2 second. We repeat those two blocks, this time setting the onboard LED to false (off).
Changing the Blink Speed
Next, lets create a variable from the Variable navigation section for the delay that the LED is on and off. Click on the Create variable... block to create a variable named delay.
Once the delay variable is created, new blocks will be created in the Variable navigation section
The number in the delay block comes from the Math navigation section.
Now we can change the blink speed easily, by only changing the value of the delay variable.
This program will blink the built-in LED on and off every 1/4 of a second. By changing the delay variable you can make the LED blink faster and slower.
Challenge
What is the fastest you can make the LED blink and still see it changing? What does this tell you about the human eye?