Program opisuje signalizaciju otvaranja garaznih vrata. Kada su vrata zatvorena svjetli crvena ledica, na pritisak tipkala pokreće se otvaranje vrata. signalizacija otvaranja vrata je titrajuća zuta ledica i zvuk iz buzzera. Kada su vrata otvorena svjetli zelena ledica.
Dependencies: Piezo_zvucnik
buzzer.h@0:054375111414, 2021-12-09 (annotated)
- Committer:
- dgerin
- Date:
- Thu Dec 09 07:52:53 2021 +0000
- Revision:
- 0:054375111414
Konstrukcijski zadatak
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dgerin | 0:054375111414 | 1 | #ifndef MBED_BEEP_H |
dgerin | 0:054375111414 | 2 | #define MBED_BEEP_H |
dgerin | 0:054375111414 | 3 | |
dgerin | 0:054375111414 | 4 | #include "mbed.h" |
dgerin | 0:054375111414 | 5 | |
dgerin | 0:054375111414 | 6 | namespace mbed { |
dgerin | 0:054375111414 | 7 | |
dgerin | 0:054375111414 | 8 | class Beep { |
dgerin | 0:054375111414 | 9 | |
dgerin | 0:054375111414 | 10 | public: |
dgerin | 0:054375111414 | 11 | |
dgerin | 0:054375111414 | 12 | Beep (PinName pin); |
dgerin | 0:054375111414 | 13 | |
dgerin | 0:054375111414 | 14 | void beep (float frequency, float time); |
dgerin | 0:054375111414 | 15 | |
dgerin | 0:054375111414 | 16 | void nobeep(); |
dgerin | 0:054375111414 | 17 | |
dgerin | 0:054375111414 | 18 | private : |
dgerin | 0:054375111414 | 19 | PwmOut _pwm; |
dgerin | 0:054375111414 | 20 | Timeout toff; |
dgerin | 0:054375111414 | 21 | }; |
dgerin | 0:054375111414 | 22 | |
dgerin | 0:054375111414 | 23 | } |
dgerin | 0:054375111414 | 24 | #endif |
dgerin | 0:054375111414 | 25 |