Alex Allen / UM12

Dependents:   Balloon

Committer:
AlexAllen
Date:
Fri Jul 22 10:57:14 2011 +0000
Revision:
2:f2cf3a42e690
Parent:
0:18297993986b
Child:
4:c947442469dd
Now added bools

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AlexAllen 0:18297993986b 1 #ifndef RADIO
AlexAllen 0:18297993986b 2
AlexAllen 0:18297993986b 3 #include "mbed.h"
AlexAllen 0:18297993986b 4
AlexAllen 0:18297993986b 5 class UM12 : private Serial
AlexAllen 0:18297993986b 6 {
AlexAllen 0:18297993986b 7 DigitalOut *sleepPin, *resetPin;
AlexAllen 0:18297993986b 8
AlexAllen 0:18297993986b 9 public:
AlexAllen 0:18297993986b 10
AlexAllen 0:18297993986b 11 UM12( PinName tx, PinName rx, PinName slp = LED1, PinName rst = LED2);
AlexAllen 0:18297993986b 12 virtual ~UM12();
AlexAllen 0:18297993986b 13
AlexAllen 0:18297993986b 14 void sleep(); // Send UM12 to sleep
AlexAllen 0:18297993986b 15 void wake(); // Wake UM12 from sleep
AlexAllen 0:18297993986b 16 void reset(); // Reset UM12
AlexAllen 0:18297993986b 17
AlexAllen 0:18297993986b 18 void send(char msg); // Send a single char
AlexAllen 2:f2cf3a42e690 19 void send(bool msg); // Send a boolean message
AlexAllen 0:18297993986b 20 void send(int msg); // Send a four byte integer
AlexAllen 0:18297993986b 21 void send(float msg); // Send a four byte floating point number
AlexAllen 0:18297993986b 22
AlexAllen 0:18297993986b 23 char receive(char &msg); // Receive a single char
AlexAllen 2:f2cf3a42e690 24 bool receive(bool &msg); // Receive a boolean
AlexAllen 0:18297993986b 25 int receive(int &msg); // Receive a four byte integer
AlexAllen 0:18297993986b 26 float receive(float &msg); // Receive a four byte floating point number
AlexAllen 0:18297993986b 27
AlexAllen 0:18297993986b 28
AlexAllen 0:18297993986b 29 };
AlexAllen 0:18297993986b 30 #define RADIO 1
AlexAllen 0:18297993986b 31 #endif