Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MMA8451Q TSI cc3000_hostdriver_mbedsocket NVIC_set_all_priorities mbed Multi_WS2811
main.cpp@48:2ba6321d79fc, 2014-12-11 (annotated)
- Committer:
- robertbui
- Date:
- Thu Dec 11 14:06:34 2014 +0000
- Revision:
- 48:2ba6321d79fc
- Parent:
- 43:cf824a44a040
- Child:
- 56:f95ec9baa4cb
Updated alpha filter values and change position of cube conditions.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| kalbers | 3:5f5d75cba8e1 | 1 | #include "mbed.h" |
| kalbers | 29:9deef77084af | 2 | //#include "main.h" |
| kalbers | 3:5f5d75cba8e1 | 3 | #include "DataGlove.h" |
| naren | 36:4a58639da6cf | 4 | #include "Glove.h" |
| naren | 36:4a58639da6cf | 5 | #include "Correction.h" |
| robertbui | 40:bdd949fc3bc2 | 6 | #include "GestureRecognition.h" |
| robertbui | 40:bdd949fc3bc2 | 7 | #include "CubeUpdateParameters.h" |
| robertbui | 40:bdd949fc3bc2 | 8 | #include "ledCube.h" |
| kalbers | 1:587189fb6d87 | 9 | |
| naren | 36:4a58639da6cf | 10 | #pragma once |
| kalbers | 1:587189fb6d87 | 11 | |
| kalbers | 3:5f5d75cba8e1 | 12 | DataGlove MasterGlove; |
| naren | 37:996bd22a633f | 13 | Correction Correct; |
| robertbui | 40:bdd949fc3bc2 | 14 | GestureRecognition gestureSet; |
| robertbui | 40:bdd949fc3bc2 | 15 | LedCube cube; |
| robertbui | 40:bdd949fc3bc2 | 16 | |
| robertbui | 40:bdd949fc3bc2 | 17 | |
| kalbers | 13:c701f1122797 | 18 | |
| kalbers | 3:5f5d75cba8e1 | 19 | int main() |
| kalbers | 3:5f5d75cba8e1 | 20 | { |
| kalbers | 35:b6fb5dd65a98 | 21 | long Counter = 0; |
| robertbui | 43:cf824a44a040 | 22 | DigitalOut StatusLED(LED2); |
| robertbui | 43:cf824a44a040 | 23 | StatusLED = 0; |
| naren | 36:4a58639da6cf | 24 | Glove unfiltered; |
| naren | 36:4a58639da6cf | 25 | Glove filtered; |
| robertbui | 40:bdd949fc3bc2 | 26 | CubeUpdateParameters params; |
| kalbers | 13:c701f1122797 | 27 | Serial pc(USBTX, USBRX); |
| kalbers | 13:c701f1122797 | 28 | pc.baud(115200); |
| robertbui | 48:2ba6321d79fc | 29 | pc.printf("Connected to PC \r\n"); |
| kalbers | 3:5f5d75cba8e1 | 30 | MasterGlove.Init(); |
| robertbui | 41:367cab0162de | 31 | cube.Init(0,0,0); |
| kalbers | 13:c701f1122797 | 32 | pc.printf("DataGlove Cube Client\r\n"); |
| robertbui | 41:367cab0162de | 33 | |
| robertbui | 41:367cab0162de | 34 | //cube.cubeUpdate(); |
| kalbers | 3:5f5d75cba8e1 | 35 | while(true) |
| kalbers | 3:5f5d75cba8e1 | 36 | { |
| naren | 36:4a58639da6cf | 37 | unfiltered = MasterGlove.ReceiveBlocking(); |
| naren | 37:996bd22a633f | 38 | filtered = Correct.Correct(unfiltered); |
| robertbui | 43:cf824a44a040 | 39 | params = gestureSet.sensorToGesture(filtered); |
| robertbui | 43:cf824a44a040 | 40 | /*params.size = 2; |
| robertbui | 41:367cab0162de | 41 | params.deltaX = 0; |
| robertbui | 41:367cab0162de | 42 | params.deltaY = 0; |
| robertbui | 41:367cab0162de | 43 | params.deltaZ = 0; |
| robertbui | 43:cf824a44a040 | 44 | params.hue = 0.5; */ |
| robertbui | 43:cf824a44a040 | 45 | cube.UpdateCube2(params); |
| kalbers | 15:b48ac00af0b8 | 46 | //pc.printf("Looping \r\n"); |
| kalbers | 15:b48ac00af0b8 | 47 | //wait(0.1); |
| robertbui | 43:cf824a44a040 | 48 | if(Counter++%25 == 0) |
| kalbers | 35:b6fb5dd65a98 | 49 | { |
| kalbers | 35:b6fb5dd65a98 | 50 | StatusLED = !StatusLED; |
| robertbui | 43:cf824a44a040 | 51 | } |
| kalbers | 1:587189fb6d87 | 52 | } |
| kalbers | 1:587189fb6d87 | 53 | } |

