tau new
Dependencies: HIDScope QEI mbed
Fork of Tau by
Diff: main.cpp
- Revision:
- 3:48397c80d0e4
- Parent:
- 2:9c3713420e24
diff -r 9c3713420e24 -r 48397c80d0e4 main.cpp --- a/main.cpp Wed Nov 01 13:52:05 2017 +0000 +++ b/main.cpp Wed Nov 01 14:13:48 2017 +0000 @@ -20,7 +20,6 @@ // Encoder //Ticker tick; -float F = 0.02; float X = 32; float N = 131; float pulse_count; @@ -28,7 +27,7 @@ QEI Encoder(A0,A1,NC,N); //Minimum wait time between rolls -float t = 1.5; +float t = 1; // Encoder measurement function void Measure() @@ -47,13 +46,16 @@ //Dice rolling function void Roll() { + //motor1DC = 0; + ledg = 1; // green led off ledr = 0; // red led on = rolling motor1PWM = 1; // motor on -> roll dice - wait(3); + wait(3.0); motor1PWM = 0; // motor off + //motor1DC = abs(motor1DC-1); // rotate other way next time //ledr = 1; // red led off @@ -64,7 +66,7 @@ int main() { - motor1DC = 1; + motor1DC = 0; ledb = 1; ledr = 1; ledg = 0;