Yeongsoo Kim / Mbed 2 deprecated Mecha_Speed_control

Dependencies:   mbed

Committer:
yeongsookim
Date:
Wed Nov 06 01:17:46 2019 +0000
Revision:
0:c88a81d07287
First commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
yeongsookim 0:c88a81d07287 1 #ifndef MBED_HallSensor_H
yeongsookim 0:c88a81d07287 2 #define MBED_HallSensor_H
yeongsookim 0:c88a81d07287 3
yeongsookim 0:c88a81d07287 4 #include "mbed.h"
yeongsookim 0:c88a81d07287 5
yeongsookim 0:c88a81d07287 6 #define PI 3.141592
yeongsookim 0:c88a81d07287 7
yeongsookim 0:c88a81d07287 8
yeongsookim 0:c88a81d07287 9 class HallSensor
yeongsookim 0:c88a81d07287 10 {
yeongsookim 0:c88a81d07287 11 public:
yeongsookim 0:c88a81d07287 12 HallSensor(PinName a);
yeongsookim 0:c88a81d07287 13
yeongsookim 0:c88a81d07287 14 int getPinState ();
yeongsookim 0:c88a81d07287 15 float getSpeed_rps();
yeongsookim 0:c88a81d07287 16
yeongsookim 0:c88a81d07287 17 protected:
yeongsookim 0:c88a81d07287 18 void risingCallback();
yeongsookim 0:c88a81d07287 19
yeongsookim 0:c88a81d07287 20 InterruptIn m_hallSensor;
yeongsookim 0:c88a81d07287 21 Timer m_timer_sec;
yeongsookim 0:c88a81d07287 22 float m_period_sec;
yeongsookim 0:c88a81d07287 23 };
yeongsookim 0:c88a81d07287 24
yeongsookim 0:c88a81d07287 25 #endif