Cubic Hand project for EECS 249A course.
Dependencies: MMA8451Q TSI cc3000_hostdriver_mbedsocket NVIC_set_all_priorities mbed Multi_WS2811
Diff: DataGlove.h
- Revision:
- 35:b6fb5dd65a98
- Parent:
- 32:bf5f545621aa
- Child:
- 37:996bd22a633f
--- a/DataGlove.h Thu Dec 11 06:37:46 2014 +0000 +++ b/DataGlove.h Thu Dec 11 06:44:30 2014 +0000 @@ -15,52 +15,53 @@ class DataGlove { - public: - DataGlove(); - ~DataGlove(); - void Init(); - void Receive(); - - //Returns the latest glove values in a structure. - Glove GetCurrentValues(); - //Returns true if new data since last function call, false otherwise. - bool CheckForNewValues(); - + public: + DataGlove(); + ~DataGlove(); + void Init(); + bool Receive(); + Glove ReceiveBlocking(); + + //Returns the latest glove values in a structure. + Glove GetCurrentValues(); + //Returns true if new data since last function call, false otherwise. + bool CheckForNewValues(); + int16_t finger1, finger2, finger3, finger4, finger5; int16_t accelx, accely, accelz; int16_t gyrox, gyroy, gyroz; - private: + private: uint8_t SendBuf[20]; int16_t notConnectedCount; - long numReceived; - char Buf[256], buffer[256]; - bool raw; - unsigned char bcc; - int pkglen, u; - int timeOfArrival, id, pkgtype; - int j, k, y; - double roll, yaw, pitch; - double norm, test; - int q0, q1, q2, q3; - double q00, q11, q22, q33; - long ReceiveCount; - bool NewData; - // Stores glove data - Glove *gl; - // Stores the correction matrix - Glove *correction; - // Stores the corrected glove values - Glove *corrected; + long numReceived; + char Buf[256], buffer[256]; + bool raw; + unsigned char bcc; + int pkglen, u; + int timeOfArrival, id, pkgtype; + int j, k, y; + double roll, yaw, pitch; + double norm, test; + int q0, q1, q2, q3; + double q00, q11, q22, q33; + long ReceiveCount; + bool NewData; + // Stores glove data + Glove *gl; + // Stores the correction matrix + Glove *correction; + // Stores the corrected glove values + Glove *corrected; GloveWifi GloveSocket; private: - void Parse(); - void StreamData(uint8_t DataType); - void StopSampling(); - void ExtractFingersQuat(); - void ExtractQuat(); - void ExtractFingersRaw(); - void ExtractRaw(); - void ExtractFingers(); + void Parse(); + void StreamData(uint8_t DataType); + void StopSampling(); + void ExtractFingersQuat(); + void ExtractQuat(); + void ExtractFingersRaw(); + void ExtractRaw(); + void ExtractFingers(); }; \ No newline at end of file