new
Diff: CommModule.h
- Revision:
- 0:fdd3f396de40
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CommModule.h Mon Nov 11 18:34:22 2013 +0000 @@ -0,0 +1,36 @@ +/********************************** + * Author: Clifton Thomas + * Date: 3/28/13 + * Institution: Georgia Tech + * + * Title: Communication Module + * Class: ECE2035 + * Assignment: Project 2 + **********************************/ + +#ifndef COMM_H +#define COMM_H + +#include <string.h> +#include "mbed.h" + +class commSerial: public Serial { +public: + //constructor + commSerial(PinName tx, PinName rx, int baudrate): Serial(tx,rx) { + Serial::baud(baudrate); + } + + //fcn to send data + void sendData(char *str) { + Serial::printf(str); + } + + //fcn to receive data + void receiveData(char *buffer) { + Serial::scanf("%s", buffer); + } + +}; + +#endif \ No newline at end of file