Local library

Dependencies:   WakeUp PinDetect

Dependents:   Inductive_Sensor Inductive_Sensor_Jasper Inductive_Sensor_3

Bob.h

Committer:
bobgiesberts
Date:
2016-08-24
Revision:
6:0e7c0ad0508b
Parent:
5:c2468a69aacb
Child:
7:0b23995256e7

File content as of revision 6:0e7c0ad0508b:

#ifndef _Bob_H_
#define _Bob_H_

/**
* @file Bob.h
* @brief collection of some functions to communicate
* with the processor board. LEDs, SD, etc.
*
* @author Bob Giesberts
*
* @date 2015-12-18
*/

#include "mbed.h"
#include "PinDetect.h"

class Bob {
    public:
    
        /** Construct a new instance of the class Bob
         * @param process_led   Pin connected to the green led, used for processing
         * @param error_led     Pin connected to the red led, used for errors
         * @param button        Pin connected to the I/O button
         * @param sd_present    Pin connected to the SDCardDetect port
         * @param battery       Pin connected to the battery
         */
        Bob(PinName process_led, PinName error_led, PinName button, PinName sd_present, PinName battery);
        ~Bob();
        
        bool checkSD(void);
        
        void wakeup(void);
        void beforesleep(void);
        void sleep(uint32_t ms);
        

        float battery(void);
        
        void flash(int n);
        void ledon(void);
        void ledoff(void);
            
    private:
        DigitalOut _led_process;
        DigitalOut _led_error;
        // DigitalOut _sd_enable;
        DigitalIn *_sd_card_detect;
        PinDetect _button;
        
        AnalogIn  *_batt;

};

#endif