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.
Diff: main.cpp
- Revision:
- 12:1c7b59097090
- Parent:
- 11:95e4e04a7dd2
- Child:
- 13:e3089b058fab
--- a/main.cpp Sun Dec 18 13:52:01 2016 +0000 +++ b/main.cpp Mon Dec 19 17:47:06 2016 +0000 @@ -2,10 +2,7 @@ #include "model.h" #include "structures.h" #include "Serial.h" - - #include "MMA8451Q.h" - #define MMA8451_I2C_ADDRESS (0x1d<<1) #define ON 0 #define OFF !ON @@ -15,22 +12,29 @@ uint8_t togstat=0;//Led status DigitalOut bled(LED_BLUE); - -Timer tms; Serial pc(USBTX,USBRX); Model *mModel=new Model(&pc); char breakEm[1]; +char watchDog[1]; void tapTrue(void){ if(togstat == 0){ breakEm[0]=0x01; - mModel->sendPacket(0xa0,0xf,0x00,breakEm,1); +// mModel->sendPacket(0xa0,0xf,0x00,breakEm,1); togstat = 1; bled=ON; - } else { + } else if(togstat==1){ breakEm[0]=0x00; - togstat = 0; + /*deaktivacia brzdy*/ +// mModel->sendPacket(0xa0,0xf,0x00,breakEm,1); +// mModel->sendPacket(0xa0,0xfe,0x00,watchDog,1); + + togstat = 2; bled=OFF; - } + }else { + togstat=0; + watchDog[0]=0x01; + + bled=ON;} } int main() @@ -43,7 +47,7 @@ while(1) { - mModel->doSomething(mModel->getSourceAdd()); + mModel->doSomething(0x59); }; } \ No newline at end of file