SunFounder Thales Kit for Raspberry Pi Pico, Release 1.0
3.4 Projects
3.4.1 Hello, LED!
Just as printing “Hello, world!” is the first step in learning programming, letting the LED light up is the traditional
entry to learning physical programming.
There is a small LED on the top of the Pico. Like other LEDs, it will glow when power is on and go out when power
is off.
Code
Let’s copy this code into Thonny and click “Run Current Script” or simply press F5 to run it to make the LED blink!
Don’t forget to left click on the bottom right corner and switch the python version name to MicroPython (Raspberry
Pi Pico).
import
machine
import
utime
led_onboard
=
machine
.
Pin(
25
, machine
.
Pin
.
OUT)
while
True
:
led_onboard
.
value(
1
)
utime
.
sleep(
2
)
led_onboard
.
value(
0
)
utime
.
sleep(
2
)
3.4. Projects
49
Summary of Contents for Thales Kit
Page 1: ...SunFounder Thales Kit for Raspberry Pi Pico Release 1 0 Jimmy SunFounder Jun 04 2021 ...
Page 2: ......
Page 4: ...ii ...
Page 6: ...SunFounder Thales Kit for Raspberry Pi Pico Release 1 0 2 CONTENTS ...
Page 140: ...SunFounder Thales Kit for Raspberry Pi Pico Release 1 0 136 Chapter 3 For MicroPython User ...
Page 164: ...SunFounder Thales Kit for Raspberry Pi Pico Release 1 0 160 Chapter 4 For Arduino User ...