![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Corrected header file include guards.
Dependencies: FiniteStateMachine HipControl Knee LinearBlend1 LocalFileSystem_Read dataComm hapticFeedback initExoVars mbed Blend_Generator Brad_poly_gait Gait_Generator MM_gait Encoders IMUdriver
Fork of Motion Control by
Diff: main.cpp
- Revision:
- 2:89b78367d173
- Parent:
- 0:d38d627c922f
- Child:
- 3:9719ad064a2c
diff -r 6f18fad9984e -r 89b78367d173 main.cpp --- a/main.cpp Sat Nov 22 00:54:39 2014 +0000 +++ b/main.cpp Mon Nov 24 03:35:08 2014 +0000 @@ -14,26 +14,18 @@ #include "mbed.h" #include "initExoVars.h" #include "FSM.h" -int dataIn[3]; +#include "dataBedComm.h" +int dataIn[4]; +int dataOut[]={0xFF,30,31,0xFE}; /////////////////////////////////////////////////////////////////////////// void periodicFcns() { - DB_cs=0; - dataIn[0]=dataBedSPI.write(7); - DB_cs=1; - wait_us(5); - DB_cs=0; - dataIn[1]=dataBedSPI.write(30); - DB_cs=1; - wait_us(5); - DB_cs=0; - dataIn[2]=dataBedSPI.write(22); - DB_cs=1; - //pc.printf("%d, %d, %d, ", dataIn[0], dataIn[1], dataIn[2]); + dataOut[1]=encoder_L.readRaw(); + dataOut[2]=encoder_R.readRaw(); + int* ptr=dataIn; + ptr=sendData(dataOut, 4, dataIn); + pc.printf("%d, %d, %d, ", dataIn[0], dataIn[1], dataIn[2], dataIn[3]); int exoState=fsm.state(dataIn[1]); - /*pc.printf("State: %u, ", exoState); - pc.printf("Angle: %f, ", translate_L(Read_Encoder())); - pc.printf("Data: %u, %u, %u\r\n", dataIn[0], dataIn[1], dataIn[2]);*/ } @@ -41,8 +33,8 @@ { pc.printf("ExoStart \r\n"); initializeExoIOs(); - pc.printf("Blah \r\n"); - pc.printf("Here \r\n"); + pc.printf("Blah\r\n"); + pc.printf("Starting exo...\n\r"); //If desired, a startup sound can be played. This function is defined in the DatabedCode, because it will command a sound to be played once it detects a heartbeat from ControlBed wait(2);