Buzzer

![]() | ![]() | ![]() | ![]() |
Peizo Buzzer
- Overview
- Drivers
- Samples
- Projects
Peizo Buzzer
Key features • Frequency Range | Resources |
Function | Description |
---|---|
DVer() | This driver version. |
PlayBeep(f, d) | Play beep, f: frequency, d: duration in ms |
PlaySound(f, d, c) | Play sound. f: frequency, d: duration in ms, c: duty cycle |
PlayMelody(a1) | Play medoly. a1 is array in float, odd elemnent: frequency, even element: duration |
StopMelody() | Stop medoly |
The Code!
Modules ship with this script preloaded. Use Console to reload or modify the drivers. Additionally, some languages, such as Python, include DUELink.Engine.Record()
for recording scripts directly from the host.
##### Driver Code Starts Here ###
fn PlayBeep(f, d)
Beep(7, f, d)
fend
fn PlaySound(f, d, c)
freq(7, f, d, c)
fend
fn PlayMelody(a1)
melodyp(7, a1)
fend
fn StopMelody()
melodys(7)
fend
fn DVer()
return 0.1
fend
##### User Code Starts Here #####
- Script
- Python
- JavaScript
Use Console to modify the default driver by adding this sample.
# Append this code at the bottom of the script, right after the driver.
# You MUST keep the driver code!!
Dim a1[31*2]= {330,200,
330,200,
330,300,
0,100,
330,200,
330,200,
330,300,
0,100,
330,200,
392,200,
262,300,
294,100,
330,400,
0,400,
349,200,
349,200,
349,300,
0, 0,
349, 100,
349, 200,
330, 200,
330, 200,
0, 0,
330, 100,
330, 100,
392, 200,
392, 200,
349, 200,
294, 200,
262, 400,
0,400}
PlayBeep(1000, 100) # play beep 1KHz, duration 100ms
wait(1000)
PlaySound(10000, 500, 0.5) # play sound 10KHz, duration 500, dutycyle 50%
wait(1000)
PlayMelody(a1) # play melody jingle.
from DUELink.DUELinkController import DUELinkController
import time
availablePort = DUELinkController.GetConnectionPort()
duelink = DUELinkController(availablePort)
//code
Coming soon!
Ordering Info
Description | Part Number | Price |
---|---|---|
Buzzer | GDL-SOBUZZER-B | $00.00 |