SunFounder Thales Kit for Raspberry Pi Pico, Release 1.0
Code
The method of controlling the extended LED is the same as the method of controlling the on-board LED, the only
difference is that the operating pin is changed to 15.
import
machine
import
utime
led
=
machine
.
Pin(
15
, machine
.
Pin
.
OUT)
while
True
:
led
.
toggle()
utime
.
sleep(
1
)
toggle()
can switch the pin between high level and low level, and you can see the LED blinking.
Also see reference here:
•
3.4.3 Reading Button Value
From the name of GPIO (General-purpose input/output), we can see that these pins have both input and output func-
tions. In the previous two lessons, we used the output function, in this chapter we will use the input function to input
read the button value.
54
Chapter 3. For MicroPython User
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 ...