圧電ブザーをwaitなしで好きなように鳴らすライブラリ

Dependents:   Tourobo2022_TBCMotorDriver

Committer:
YutaTogashi
Date:
Thu Oct 03 09:34:57 2019 +0000
Revision:
0:97f383c12e42
Child:
1:96bd2135c3bf
20191003

Who changed what in which revision?

UserRevisionLine numberNew contents of line
YutaTogashi 0:97f383c12e42 1 #ifndef BUZZER_H
YutaTogashi 0:97f383c12e42 2 #define BUZZER_H
YutaTogashi 0:97f383c12e42 3 #include "mbed.h"
YutaTogashi 0:97f383c12e42 4
YutaTogashi 0:97f383c12e42 5 class buzzer {
YutaTogashi 0:97f383c12e42 6 public:
YutaTogashi 0:97f383c12e42 7 buzzer(PinName buzzerPin);
YutaTogashi 0:97f383c12e42 8 void output(unsigned int count,float period);
YutaTogashi 0:97f383c12e42 9 void output(bool buzzerStates);
YutaTogashi 0:97f383c12e42 10 void stop();
YutaTogashi 0:97f383c12e42 11 private:
YutaTogashi 0:97f383c12e42 12 DigitalOut _buzzer;
YutaTogashi 0:97f383c12e42 13 Ticker _timer;
YutaTogashi 0:97f383c12e42 14
YutaTogashi 0:97f383c12e42 15 void timerFunction();
YutaTogashi 0:97f383c12e42 16 int _counter,_setCount,_timerFlag;
YutaTogashi 0:97f383c12e42 17
YutaTogashi 0:97f383c12e42 18 };
YutaTogashi 0:97f383c12e42 19
YutaTogashi 0:97f383c12e42 20 #endif