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:
- 4:28919318b141
- Parent:
- 3:4dc457ed63d5
- Child:
- 5:979ff570efce
diff -r 4dc457ed63d5 -r 28919318b141 main.cpp --- a/main.cpp Sat Mar 20 17:54:12 2021 +0000 +++ b/main.cpp Sun Mar 21 22:58:15 2021 +0000 @@ -78,17 +78,16 @@ while(!full); //wait(2); full=false; + pc1.printf("****** TEMPERATURA *****"); pc1.printf("\n%d\n", rdLen); for(int i = 0;i<rdLen;i++){ pc1.printf("%X ",recBuff[i]); } - - int voltage = recBuff[5]; //LSB voltage |= (recBuff[4]) << 8; //MSB double vol = voltage*0.0001907349; //double vol = ((double)voltage)/65536.0 * 5.0; - pc1.printf("temp1 = %6.2f V\n", vol); + pc1.printf("temp1 = %f V\n", vol); } void waitFrameResponse(){ @@ -102,8 +101,11 @@ int main(){ + pc1.printf("Main ulazak\n"); bms.attach(&callback); + pc1.printf("Main after attacha\n"); Wake79606(); + pc1.printf("woken up\n"); //DigitalOut(PA_0, 0); //DigitalOut(PA_1, 0); //wait(1); @@ -134,8 +136,8 @@ WriteReg(0, CONTROL2, 0x01, 1, FRMWRT_ALL_NR); //CELL_ADC_GO = 1 wait_ms(5);*/ - bmsWakeUp = 0; - + //bmsWakeUp = 0; + pc1.printf("Pre while-a\n"); while (1) { pc1.printf("Main Code \n"); @@ -152,9 +154,10 @@ waitFrame(); - //ReadReg(0, AUX_GPIO1H, pFrame1, 2 , 0, FRMWRT_ALL_R); + WriteReg(0, CONTROL2, 0x02, 1, FRMWRT_ALL_NR); + ReadReg(0, AUX_GPIO1H, pFrame1, 2 , 0, FRMWRT_ALL_R); - //waitFrameTemp(); + waitFrameTemp(); //slanje zahteva za GRESKAMA