Railway Challenge / Mbed 2 deprecated challenge

Dependencies:   mbed millis

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers dashboard.h Source File

dashboard.h

00001 #ifndef _DASHBOARD_H_
00002 #define _DASHBOARD_H_
00003 
00004 #include <mbed.h>
00005 
00006 class Dashboard {
00007     public:
00008         Dashboard(InterruptIn& hallSensor);    // CONSTRUCTOR
00009         
00010         void tachoInterrupt();
00011         void getCurrentSpeed();
00012         
00013         int currentSpeed;
00014         float currentDistance;
00015         
00016     private:
00017         InterruptIn& _hallSensor;
00018         Timer tachoTimer;
00019         int passedTime_ms;
00020         float passedTime;
00021         float lastTime;
00022         float wheelFreq;
00023         float wheelCircumference;
00024         int numberOfMagnets;
00025         int tachoCounter;
00026         int currentTime;
00027 };
00028 
00029 #endif