Skip to content

Commit b3b76be

Browse files
committed
tests: Add board qualification tests for buzzer.
1 parent bc70f05 commit b3b76be

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

tests/scenarios/board_buzzer.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
type: board
2+
name: "board_buzzer"
3+
4+
tests:
5+
- name: "Buzzer tone 440Hz"
6+
action: hardware_script
7+
script: |
8+
from machine import Pin, PWM
9+
from time import sleep_ms
10+
pwm = PWM(Pin("SPEAKER"), freq=440, duty_u16=32768)
11+
sleep_ms(500)
12+
pwm.deinit()
13+
result = True
14+
expect_true: true
15+
mode: [hardware]
16+
17+
- name: "Buzzer 440Hz audible"
18+
action: manual
19+
prompt: "Avez-vous entendu un bip (La 440Hz) ?"
20+
expect_true: true
21+
mode: [hardware]
22+
23+
- name: "Buzzer frequency sweep"
24+
action: hardware_script
25+
script: |
26+
from machine import Pin, PWM
27+
from time import sleep_ms
28+
pwm = PWM(Pin("SPEAKER"), freq=200, duty_u16=32768)
29+
for f in range(200, 2001, 100):
30+
pwm.freq(f)
31+
sleep_ms(50)
32+
pwm.deinit()
33+
result = True
34+
expect_true: true
35+
mode: [hardware]
36+
37+
- name: "Buzzer sweep audible"
38+
action: manual
39+
prompt: "Avez-vous entendu un balayage de fréquence (grave vers aigu) ?"
40+
expect_true: true
41+
mode: [hardware]

0 commit comments

Comments
 (0)