3Dezibot dezibot = Dezibot();
4const int centeredThreshold = 50 ;
7 // put your setup code here, to run once:
13 int32_t leftValue = (int32_t)dezibot.lightDetection.getAverageValue(IR_LEFT, 20, 1);
14 int32_t rightValue = (int32_t)dezibot.lightDetection.getAverageValue(IR_RIGHT, 20, 1);
15 switch(dezibot.lightDetection.getBrightest(IR)){
17 //correct Stearing to be centered
18 if( abs(leftValue-rightValue)
20 dezibot.motion.move();
22 if (leftValue > rightValue){
23 dezibot.motion.rotateAntiClockwise();
25 dezibot.motion.rotateClockwise();
28 dezibot.multiColorLight.setTopLeds(BLUE);
31 dezibot.motion.rotateAntiClockwise();
32 dezibot.multiColorLight.setTopLeds(RED);
35 dezibot.motion.rotateClockwise();
36 dezibot.multiColorLight.setTopLeds(GREEN);
39 if(leftValue > rightValue){
40 dezibot.motion.rotateAntiClockwise();
42 dezibot.motion.rotateClockwise();
44 dezibot.multiColorLight.setTopLeds(YELLOW);