SunFounder Thales Kit for Raspberry Pi Pico, Release 1.0
Wiring
1. Connect 3V3 and GND of Pico to the power bus of the breadboard.
2. Insert the potentiometer into the breadboard, its three pins should be in different rows.
3. Use jumper wires to connect the pins on both sides of the potentiometer to the positive and negative power bus
respectively.
4. Connect the middle pin of the potentiometer to GP28 with a jumper wire.
5. Connect the anode of the LED to the GP15 pin through a 220 resistor, and connect the cathode to the negative
power bus.
Code
When the program is running, we can see the analog value currently read by the GP28 pin in the shell. Turn the knob,
and the value will change from 0 to 65535. At the same time, the brightness of the LED will increase as the analog
value increases.
import
machine
import
utime
potentiometer
=
machine
.
ADC(
28
)
led
=
machine
.
PWM(machine
.
Pin(
15
))
led
.
freq(
1000
)
(continues on next page)
3.4. Projects
89
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 ...