SunFounder Thales Kit for Raspberry Pi Pico, Release 1.0
1. Connect 3V3 and GND of Pico to the power bus of the breadboard.
2. Connect the positive pin of the buzzer to the positive power bus.
3. Connect the cathode pin of the buzzer to the
collector
lead of the transistor.
4. Connect the
base
lead of the transistor to the GP15 pin through a 1k resistor.
5. Connect the
emitter
lead of the transistor to the negative power bus.
Note:
The color ring of the 1k ohm resistor is brown, black, black, brown and brown.
Code
import
machine
import
utime
buzzer
=
machine
.
PWM(machine
.
Pin(
15
))
def
tone
(pin,frequency,duration):
pin
.
freq(frequency)
pin
.
duty_u16(
30000
)
utime
.
sleep_ms(duration)
pin
.
duty_u16(
0
)
tone(buzzer,
440
,
250
)
utime
.
sleep_ms(
500
)
(continues on next page)
3.4. Projects
83
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 ...