Main code of our project.
Dependencies: TextLCD mbed PID
Diff: main.cpp
- Revision:
- 7:1f7d87007512
- Parent:
- 6:756d44ed75a5
- Child:
- 8:a161b056971c
--- a/main.cpp Wed Oct 10 05:06:58 2018 +0000 +++ b/main.cpp Wed Oct 10 05:50:52 2018 +0000 @@ -85,9 +85,8 @@ lcd.locate(0,0);//(col,row) lcd.printf("V&f OK"); while(!synchronized){//phase matching loop - pc.printf("diff: %f\n\r", getVolageReadedMax(differentialPin)); //phase matching - if(getVolageReadedMax(differentialPin) < 0.350){ + if(getVolageReadedMax(differentialPin) < 0.050){ pc.printf("SYNCHONIZATION OK\r\n\n"); lcd.locate(0,1);//(col,row) lcd.printf("SYNC OK "); @@ -128,9 +127,9 @@ float valuePotar1; float valuePotar2; valuePotar1 = potarDC.read(); - pwmDC.write(valuePotar1); + pwmDC.write(1-valuePotar1); valuePotar2 = potarSY.read(); - pwmSY.write(valuePotar2); + pwmSY.write(1-valuePotar2); //lcd.locate(12,0);//(col,row) //lcd.printf("%f",valuePotar); } @@ -166,7 +165,6 @@ v1Max = v1; } } - pc.printf("v1Max=%f\r\n",v1Max); return v1Max; }