Alex Allen / UM12

Dependents:   Balloon

UM12.h

Committer:
AlexAllen
Date:
2011-07-22
Revision:
2:f2cf3a42e690
Parent:
0:18297993986b
Child:
4:c947442469dd

File content as of revision 2:f2cf3a42e690:

#ifndef RADIO

    #include "mbed.h"

    class UM12 : private Serial
    {
        DigitalOut *sleepPin, *resetPin;
        
        public:
        
        UM12( PinName tx, PinName rx, PinName slp = LED1, PinName rst = LED2);
        virtual ~UM12();
        
        void sleep(); // Send UM12 to sleep
        void wake(); // Wake UM12 from sleep
        void reset(); // Reset UM12
        
        void send(char msg); // Send a single char
        void send(bool msg); // Send a boolean message
        void send(int msg); // Send a four byte integer
        void send(float msg); // Send a four byte floating point number
        
        char receive(char &msg); // Receive a single char
        bool receive(bool &msg); // Receive a boolean
        int receive(int &msg); // Receive a four byte integer
        float receive(float &msg); // Receive a four byte floating point number
        
        
    };
    #define RADIO 1
#endif