|
| 1 | +type: board |
| 2 | +name: "board_leds" |
| 3 | + |
| 4 | +tests: |
| 5 | + - name: "LED RED on/off" |
| 6 | + action: hardware_script |
| 7 | + script: | |
| 8 | + from machine import Pin |
| 9 | + from time import sleep_ms |
| 10 | + led = Pin("LED_RED", Pin.OUT) |
| 11 | + led.on() |
| 12 | + sleep_ms(1000) |
| 13 | + led.off() |
| 14 | + result = True |
| 15 | + expect_true: true |
| 16 | + mode: [hardware] |
| 17 | + |
| 18 | + - name: "LED RED visible" |
| 19 | + action: manual |
| 20 | + prompt: "La LED rouge s'est-elle allumée puis éteinte ?" |
| 21 | + expect_true: true |
| 22 | + mode: [hardware] |
| 23 | + |
| 24 | + - name: "LED GREEN on/off" |
| 25 | + action: hardware_script |
| 26 | + script: | |
| 27 | + from machine import Pin |
| 28 | + from time import sleep_ms |
| 29 | + led = Pin("LED_GREEN", Pin.OUT) |
| 30 | + led.on() |
| 31 | + sleep_ms(1000) |
| 32 | + led.off() |
| 33 | + result = True |
| 34 | + expect_true: true |
| 35 | + mode: [hardware] |
| 36 | + |
| 37 | + - name: "LED GREEN visible" |
| 38 | + action: manual |
| 39 | + prompt: "La LED verte s'est-elle allumée puis éteinte ?" |
| 40 | + expect_true: true |
| 41 | + mode: [hardware] |
| 42 | + |
| 43 | + - name: "LED BLUE on/off" |
| 44 | + action: hardware_script |
| 45 | + script: | |
| 46 | + from machine import Pin |
| 47 | + from time import sleep_ms |
| 48 | + led = Pin("LED_BLUE", Pin.OUT) |
| 49 | + led.on() |
| 50 | + sleep_ms(1000) |
| 51 | + led.off() |
| 52 | + result = True |
| 53 | + expect_true: true |
| 54 | + mode: [hardware] |
| 55 | + |
| 56 | + - name: "LED BLUE visible" |
| 57 | + action: manual |
| 58 | + prompt: "La LED bleue s'est-elle allumée puis éteinte ?" |
| 59 | + expect_true: true |
| 60 | + mode: [hardware] |
| 61 | + |
| 62 | + - name: "RGB LED full cycle" |
| 63 | + action: hardware_script |
| 64 | + script: | |
| 65 | + from machine import Pin |
| 66 | + from time import sleep_ms |
| 67 | + r = Pin("LED_RED", Pin.OUT) |
| 68 | + g = Pin("LED_GREEN", Pin.OUT) |
| 69 | + b = Pin("LED_BLUE", Pin.OUT) |
| 70 | + for led in [r, g, b]: |
| 71 | + led.on() |
| 72 | + sleep_ms(500) |
| 73 | + led.off() |
| 74 | + # White = all on |
| 75 | + r.on(); g.on(); b.on() |
| 76 | + sleep_ms(1000) |
| 77 | + r.off(); g.off(); b.off() |
| 78 | + result = True |
| 79 | + expect_true: true |
| 80 | + mode: [hardware] |
| 81 | + |
| 82 | + - name: "RGB LED full cycle visible" |
| 83 | + action: manual |
| 84 | + prompt: "La LED a-t-elle affiché rouge, vert, bleu, puis blanc ?" |
| 85 | + expect_true: true |
| 86 | + mode: [hardware] |
| 87 | + |
| 88 | + - name: "LED BLE on/off" |
| 89 | + action: hardware_script |
| 90 | + script: | |
| 91 | + from machine import Pin |
| 92 | + from time import sleep_ms |
| 93 | + led = Pin("LED_BLE", Pin.OUT) |
| 94 | + led.on() |
| 95 | + sleep_ms(1000) |
| 96 | + led.off() |
| 97 | + result = True |
| 98 | + expect_true: true |
| 99 | + mode: [hardware] |
| 100 | + |
| 101 | + - name: "LED BLE visible" |
| 102 | + action: manual |
| 103 | + prompt: "La LED BLE (bleue) s'est-elle allumée puis éteinte ?" |
| 104 | + expect_true: true |
| 105 | + mode: [hardware] |
0 commit comments