Railway Challenge / Mbed 2 deprecated challenge-2022Fork

Dependencies:   mbed millis

dashboard.h

Committer:
as96
Date:
2023-06-23
Revision:
39:c36b75a3402e
Parent:
36:5c61710813b3

File content as of revision 39:c36b75a3402e:

#ifndef _DASHBOARD_H_
#define _DASHBOARD_H_

#include <mbed.h>

class Dashboard {
    public:
        Dashboard(InterruptIn& hallSensor);    // CONSTRUCTOR
        
        void tachoInterrupt();
        void getCurrentSpeed();
        
        int currentSpeed;
        float currentDistance;
        
    private:
        InterruptIn& _hallSensor;
        Timer tachoTimer;
        int passedTime_ms;
        float passedTime;
        float lastTime;
        float wheelFreq;
        float wheelCircumference;
        int numberOfMagnets;
        int tachoCounter;
        int currentTime;
};

#endif