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.
Dependencies: EMG HIDScope PID QEI mbed TextLCD
Diff: inits.h
- Revision:
- 10:819fb5288aa0
- Parent:
- 9:3e19a344c025
- Child:
- 11:c5042e19a096
--- a/inits.h Mon Oct 26 14:26:13 2015 +0000 +++ b/inits.h Tue Oct 27 17:18:17 2015 +0000 @@ -28,17 +28,21 @@ DigitalIn edgeright(PTC7); DigitalIn edgetop(PTC0); DigitalIn edgebottom(PTC9); +DigitalIn edgeStart(PTC8); +DigitalIn edgeFinish(PTC1); -// emg input +// pot input AnalogIn pot1(A0); AnalogIn pot2(A1); // user interface -DigitalOut outofboundsled(LED1); +DigitalOut statusled(LED_GREEN); InterruptIn startButton(D3); +bool calibrated=false; // bool to determine if button press has to start calibration or the game InterruptIn stopButton(D2); InterruptIn initpositionButton(PTC6); HIDScope scope(5); +bool controlbypc=false; //////////////////////////// //////// Timers //////////// @@ -59,15 +63,15 @@ // Working variables for motors -volatile int leftPulses = 0; +volatile float leftPulses = 0; volatile float leftAngle=0; -volatile int leftPrevPulses = 0; +volatile float leftPrevPulses = 0; volatile float leftPwmDuty = 0.0; volatile float leftVelocity = 0.0; float leftRequest=0; -volatile int rightPulses = 0; -volatile int rightPrevPulses = 0; +volatile float rightPulses = 0; +volatile float rightPrevPulses = 0; volatile float rightAngle =0; volatile float rightPwmDuty = 0.0; volatile float rightVelocity = 0.0; @@ -78,7 +82,7 @@ float verrequest; float grenslaag=0.3; float grenshoog=0.7; -float round=27720; +float round=4200.0*6.6*6.6; float maxspeed=1; //cm/sec float currentX; float currentY;