![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Hall Sensor 6step BLDC
Diff: main.cpp
- Revision:
- 2:7a89b67efc84
- Parent:
- 1:cfa36edc2232
- Child:
- 3:842fce070123
--- a/main.cpp Sat Jun 01 04:09:00 2019 +0000 +++ b/main.cpp Sat Jun 08 03:23:13 2019 +0000 @@ -100,30 +100,30 @@ if((Vr_adc>0.15f)&&(q==0)){ while(q<50){ - mypwmA.write(0.0); //0.5 - mypwmB.write(0.5f); + mypwmA.write(0.5f); //0.5 + mypwmB.write(0.0); mypwmC.write(0.0); wait_ms(START); mypwmA.write(0.0); - mypwmB.write(0.0);//0.5 - mypwmC.write(0.5f); + mypwmB.write(0.5f);//0.5 + mypwmC.write(0.0); wait_ms(START); - mypwmA.write(0.5f); + mypwmA.write(0.0); mypwmB.write(0.0); - mypwmC.write(0.0); //0.5 + mypwmC.write(0.5f); //0.5 wait_ms(START); q++; } } - HA.rise(&HBH); - HC.fall(&HAL); - HB.rise(&HCH); - HA.fall(&HBL); - HC.rise(&HAH); - HB.fall(&HCL); + HA.rise(&HAH); + HC.fall(&HCL); + HB.rise(&HBH); + HA.fall(&HAL); + HC.rise(&HCH); + HB.fall(&HBL); // s=0; if(Vr_adc < 0.1f){