STM32F302R8 with Konrad's inverter boards for senior design.
Fork of Blue_Board_Ticker by
Diff: main.cpp
- Revision:
- 12:d34b96d7f997
- Parent:
- 11:8dc1e36579e2
- Child:
- 13:08c700d71324
--- a/main.cpp Wed Apr 13 17:40:36 2016 +0000 +++ b/main.cpp Wed Apr 13 17:59:31 2016 +0000 @@ -18,6 +18,7 @@ InterruptIn hallC(PB_10); //H3, White Ticker rpmInterrupt; +Ticker spinTicker; int revCount = 0; int rpmPrintFlag = 0; int currentRPM; @@ -104,38 +105,26 @@ if(h1 == 0 && h2 == 1 && h3 == 1) //state1 { Brise(); - Afall(); - Crise(); } else if(h1 == 0 && h2 == 0 && h3 == 1) //state2 { Afall(); - Crise(); - Bfall(); } else if(h1 == 1 && h2 == 0 && h3 == 1) //state3 { Crise(); - Bfall(); - Arise(); } else if(h1 == 1 && h2 == 0 && h3 == 0) //state4 { Bfall(); - Arise(); - Cfall(); } else if(h1 == 1 && h2 == 1 && h3 == 0) //state5 { Arise(); - Cfall(); - Brise(); } else //(h1 == 0 && h2 == 1 && h3 == 0)state6 { Cfall(); - Brise(); - Afall(); } } @@ -196,14 +185,14 @@ phaseBEN = 0; phaseCEN = 0; //begin sensored mode - hallA.fall(&Afall); - hallA.rise(&Arise); - hallB.fall(&Bfall); - hallB.rise(&Brise); - hallC.fall(&Cfall); - hallC.rise(&Crise); +// hallA.fall(&Afall); +// hallA.rise(&Arise); +// hallB.fall(&Bfall); +// hallB.rise(&Brise); +// hallC.fall(&Cfall); +// hallC.rise(&Crise); - jumpStart(); + spinTicker.attach_us(&jumpStart, 100); float ADCSum = 0;; int ADCCount = 0; while(1) {