Joy-it RB-P-XPLR-SET handleiding

37 pagina's
PDF beschikbaar

Handleiding

Je bekijkt pagina 7 van 37
4. MODULES IN DETAIL
In the following, all modules available on the Explorer Board are explained individually with sample codes. Here you can download all sample codes and
libraries, as well as a sample code that links all modules together.
For the use of some modules, external libraries and a font file are used. Download the libraries and load them into the lib folder of your Raspberry Pi Pico.
Place the font file in the root directory of your Raspberry Pi Pico.
4.1 BUZZER
A buzzer produces a signal tone, similar to a loudspeaker. Unlike a loudspeaker, however, it is only suitable for a limited frequency range, so it does not
produce a good sound for reproducing music or speech. However, it is ideal for generating loud warning tones in the form of beeps. Whenever an electrical
device generates a warning tone, it is almost always a buzzer. For example, in alarm clocks, smoke detectors or the seatbelt reminder in cars.
The buzzer is connected to GPIO pin GP27.
# Load libraries
from machine import Pin, PWM
buzzerPin = Pin(27)
buzzer = PWM(buzzerPin)
while True:
# Activate buzzer for 1 sec
buzzer.freq(1000)
buzzer.duty_u16(1000)
sleep(1)
buzzer.duty_u16(0)
sleep(1)
7

Bekijk gratis de handleiding van Joy-it RB-P-XPLR-SET, stel vragen en lees de antwoorden op veelvoorkomende problemen, of gebruik onze assistent om sneller informatie in de handleiding te vinden of uitleg te krijgen over specifieke functies.

Productinformatie

MerkJoy-it
ModelRB-P-XPLR-SET
CategorieNiet gecategoriseerd
TaalNederlands
Grootte21690 MB