han back
/
CLEO_BUZZER
SMART CLEO Buzzer
main.cpp@0:1111e1dc9eb2, 2017-09-28 (annotated)
- Committer:
- SMART_CLEO
- Date:
- Thu Sep 28 02:08:54 2017 +0000
- Revision:
- 0:1111e1dc9eb2
SMART_CLEO
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
SMART_CLEO | 0:1111e1dc9eb2 | 1 | #include "mbed.h" |
SMART_CLEO | 0:1111e1dc9eb2 | 2 | |
SMART_CLEO | 0:1111e1dc9eb2 | 3 | PinName pin_BUZZER = PD_2; |
SMART_CLEO | 0:1111e1dc9eb2 | 4 | |
SMART_CLEO | 0:1111e1dc9eb2 | 5 | DigitalOut Buzzer(pin_BUZZER); |
SMART_CLEO | 0:1111e1dc9eb2 | 6 | |
SMART_CLEO | 0:1111e1dc9eb2 | 7 | int main() { |
SMART_CLEO | 0:1111e1dc9eb2 | 8 | |
SMART_CLEO | 0:1111e1dc9eb2 | 9 | while(1) { |
SMART_CLEO | 0:1111e1dc9eb2 | 10 | Buzzer = 1; // Buzzer On |
SMART_CLEO | 0:1111e1dc9eb2 | 11 | wait(0.5); |
SMART_CLEO | 0:1111e1dc9eb2 | 12 | Buzzer = 0; // Buzzer Off |
SMART_CLEO | 0:1111e1dc9eb2 | 13 | wait(0.5); |
SMART_CLEO | 0:1111e1dc9eb2 | 14 | } |
SMART_CLEO | 0:1111e1dc9eb2 | 15 | } |