Total control sjoel robot

Dependencies:   HIDScope MODSERIAL QEI TextLCD mbed

Committer:
RichardRoos
Date:
Tue Oct 20 13:54:54 2015 +0000
Revision:
37:090ba5b1e655
Parent:
27:f62e450bb411
Kalibratie rotatie werkt nog niet zo goed. Blijft vast zitten in aim calibration

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Bartvaart 18:eec0880fcded 1 #include "Mode.h"
Bartvaart 18:eec0880fcded 2
Bartvaart 18:eec0880fcded 3 double mode;
Bartvaart 18:eec0880fcded 4
RemcoDas 27:f62e450bb411 5 int Mode(double y, double thresholdlow, double thresholdmid, double thresholdhigh){
Bartvaart 18:eec0880fcded 6 if ( y <= thresholdlow){
Bartvaart 18:eec0880fcded 7 mode = 1;
Bartvaart 18:eec0880fcded 8 }
Bartvaart 19:6c0245063b96 9 if (y > thresholdhigh){
Bartvaart 19:6c0245063b96 10 mode = 3;
Bartvaart 19:6c0245063b96 11 }
Bartvaart 18:eec0880fcded 12 if (y > thresholdmid && mode == 1){
Bartvaart 18:eec0880fcded 13 mode = 2;
Bartvaart 18:eec0880fcded 14 }
Bartvaart 18:eec0880fcded 15 return mode;
Bartvaart 18:eec0880fcded 16 }