Cubic Hand project for EECS 249A course.
Dependencies: MMA8451Q TSI cc3000_hostdriver_mbedsocket NVIC_set_all_priorities mbed Multi_WS2811
DataGlove.h@42:4e1aaab14886, 2014-12-11 (annotated)
- Committer:
- kalbers
- Date:
- Thu Dec 11 12:16:09 2014 +0000
- Revision:
- 42:4e1aaab14886
- Parent:
- 41:367cab0162de
- Child:
- 52:0f7a239cdd09
- Child:
- 53:335f24b671f8
Reduced Memory usage of DataGlove Class.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kalbers | 3:5f5d75cba8e1 | 1 | #include "GloveWifi.h" |
naren | 36:4a58639da6cf | 2 | #include "Glove.h" |
kalbers | 3:5f5d75cba8e1 | 3 | |
kalbers | 13:c701f1122797 | 4 | #pragma once |
kalbers | 13:c701f1122797 | 5 | |
kalbers | 3:5f5d75cba8e1 | 6 | class DataGlove |
kalbers | 3:5f5d75cba8e1 | 7 | { |
kalbers | 35:b6fb5dd65a98 | 8 | public: |
kalbers | 35:b6fb5dd65a98 | 9 | DataGlove(); |
kalbers | 35:b6fb5dd65a98 | 10 | ~DataGlove(); |
kalbers | 35:b6fb5dd65a98 | 11 | void Init(); |
kalbers | 35:b6fb5dd65a98 | 12 | bool Receive(); |
kalbers | 35:b6fb5dd65a98 | 13 | Glove ReceiveBlocking(); |
kalbers | 35:b6fb5dd65a98 | 14 | |
kalbers | 35:b6fb5dd65a98 | 15 | //Returns the latest glove values in a structure. |
kalbers | 35:b6fb5dd65a98 | 16 | Glove GetCurrentValues(); |
kalbers | 35:b6fb5dd65a98 | 17 | //Returns true if new data since last function call, false otherwise. |
kalbers | 35:b6fb5dd65a98 | 18 | bool CheckForNewValues(); |
kalbers | 35:b6fb5dd65a98 | 19 | |
kalbers | 3:5f5d75cba8e1 | 20 | int16_t finger1, finger2, finger3, finger4, finger5; |
kalbers | 3:5f5d75cba8e1 | 21 | int16_t accelx, accely, accelz; |
kalbers | 3:5f5d75cba8e1 | 22 | int16_t gyrox, gyroy, gyroz; |
kalbers | 3:5f5d75cba8e1 | 23 | |
kalbers | 35:b6fb5dd65a98 | 24 | private: |
kalbers | 3:5f5d75cba8e1 | 25 | uint8_t SendBuf[20]; |
kalbers | 3:5f5d75cba8e1 | 26 | int16_t notConnectedCount; |
kalbers | 35:b6fb5dd65a98 | 27 | long numReceived; |
kalbers | 42:4e1aaab14886 | 28 | char Buf[256];//, buffer[256]; |
kalbers | 42:4e1aaab14886 | 29 | //bool raw; |
kalbers | 35:b6fb5dd65a98 | 30 | unsigned char bcc; |
kalbers | 35:b6fb5dd65a98 | 31 | int pkglen, u; |
kalbers | 35:b6fb5dd65a98 | 32 | int timeOfArrival, id, pkgtype; |
kalbers | 35:b6fb5dd65a98 | 33 | int j, k, y; |
kalbers | 35:b6fb5dd65a98 | 34 | double roll, yaw, pitch; |
kalbers | 35:b6fb5dd65a98 | 35 | double norm, test; |
kalbers | 35:b6fb5dd65a98 | 36 | int q0, q1, q2, q3; |
kalbers | 35:b6fb5dd65a98 | 37 | double q00, q11, q22, q33; |
kalbers | 35:b6fb5dd65a98 | 38 | long ReceiveCount; |
kalbers | 35:b6fb5dd65a98 | 39 | bool NewData; |
kalbers | 35:b6fb5dd65a98 | 40 | // Stores glove data |
robertbui | 41:367cab0162de | 41 | Glove gl; |
kalbers | 3:5f5d75cba8e1 | 42 | GloveWifi GloveSocket; |
kalbers | 18:6737bf53ccd1 | 43 | |
kalbers | 18:6737bf53ccd1 | 44 | private: |
kalbers | 35:b6fb5dd65a98 | 45 | void Parse(); |
kalbers | 35:b6fb5dd65a98 | 46 | void StreamData(uint8_t DataType); |
kalbers | 35:b6fb5dd65a98 | 47 | void StopSampling(); |
kalbers | 35:b6fb5dd65a98 | 48 | void ExtractFingersQuat(); |
kalbers | 35:b6fb5dd65a98 | 49 | void ExtractQuat(); |
kalbers | 35:b6fb5dd65a98 | 50 | void ExtractFingersRaw(); |
kalbers | 35:b6fb5dd65a98 | 51 | void ExtractRaw(); |
kalbers | 35:b6fb5dd65a98 | 52 | void ExtractFingers(); |
kalbers | 3:5f5d75cba8e1 | 53 | }; |