![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
this is the library of the code of the second laboration.
Dependencies: SILABS_RHT mbed MemoryLCD
lb123.cpp@0:33ae04d01fd6, 2020-09-04 (annotated)
- Committer:
- mara1802
- Date:
- Fri Sep 04 11:39:49 2020 +0000
- Revision:
- 0:33ae04d01fd6
lab2
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mara1802 | 0:33ae04d01fd6 | 1 | #include "lb123.h" |
mara1802 | 0:33ae04d01fd6 | 2 | led::led() : led0(PF4), led1(PF5) |
mara1802 | 0:33ae04d01fd6 | 3 | { |
mara1802 | 0:33ae04d01fd6 | 4 | |
mara1802 | 0:33ae04d01fd6 | 5 | } |
mara1802 | 0:33ae04d01fd6 | 6 | |
mara1802 | 0:33ae04d01fd6 | 7 | void led::toggle_led0() |
mara1802 | 0:33ae04d01fd6 | 8 | { |
mara1802 | 0:33ae04d01fd6 | 9 | led0 = !led0; |
mara1802 | 0:33ae04d01fd6 | 10 | } |
mara1802 | 0:33ae04d01fd6 | 11 | |
mara1802 | 0:33ae04d01fd6 | 12 | void led::toggle_led1() |
mara1802 | 0:33ae04d01fd6 | 13 | { |
mara1802 | 0:33ae04d01fd6 | 14 | led1 = !led1; |
mara1802 | 0:33ae04d01fd6 | 15 | } |
mara1802 | 0:33ae04d01fd6 | 16 | |
mara1802 | 0:33ae04d01fd6 | 17 | void led::on_led0() |
mara1802 | 0:33ae04d01fd6 | 18 | { |
mara1802 | 0:33ae04d01fd6 | 19 | led0 = 1; |
mara1802 | 0:33ae04d01fd6 | 20 | } |
mara1802 | 0:33ae04d01fd6 | 21 | |
mara1802 | 0:33ae04d01fd6 | 22 | void led::on_led1() |
mara1802 | 0:33ae04d01fd6 | 23 | { |
mara1802 | 0:33ae04d01fd6 | 24 | led1 = 1; |
mara1802 | 0:33ae04d01fd6 | 25 | } |
mara1802 | 0:33ae04d01fd6 | 26 | |
mara1802 | 0:33ae04d01fd6 | 27 | void led::off_led0() |
mara1802 | 0:33ae04d01fd6 | 28 | { |
mara1802 | 0:33ae04d01fd6 | 29 | led0 = 0; |
mara1802 | 0:33ae04d01fd6 | 30 | } |
mara1802 | 0:33ae04d01fd6 | 31 | void led::off_led1() |
mara1802 | 0:33ae04d01fd6 | 32 | { |
mara1802 | 0:33ae04d01fd6 | 33 | led1 = 0; |
mara1802 | 0:33ae04d01fd6 | 34 | } |
mara1802 | 0:33ae04d01fd6 | 35 | |
mara1802 | 0:33ae04d01fd6 | 36 | void led::blink_led0() |
mara1802 | 0:33ae04d01fd6 | 37 | { |
mara1802 | 0:33ae04d01fd6 | 38 | led0=!led0; |
mara1802 | 0:33ae04d01fd6 | 39 | wait(0.1); |
mara1802 | 0:33ae04d01fd6 | 40 | led0=!led0; |
mara1802 | 0:33ae04d01fd6 | 41 | } |
mara1802 | 0:33ae04d01fd6 | 42 | |
mara1802 | 0:33ae04d01fd6 | 43 | void led::blink_led1() |
mara1802 | 0:33ae04d01fd6 | 44 | { |
mara1802 | 0:33ae04d01fd6 | 45 | led1=!led1; |
mara1802 | 0:33ae04d01fd6 | 46 | wait(0.1); |
mara1802 | 0:33ae04d01fd6 | 47 | led1=!led1; |
mara1802 | 0:33ae04d01fd6 | 48 | } |
mara1802 | 0:33ae04d01fd6 | 49 |