mirror of
https://gitlab.dit.htwk-leipzig.de/phillip.kuehne/dezibot.git
synced 2025-05-21 20:11:46 +02:00
first basic but working version of fiend a friend
This commit is contained in:
parent
53ba11839f
commit
9314683201
@ -1,7 +1,7 @@
|
||||
#include "Dezibot.h"
|
||||
|
||||
Dezibot dezibot = Dezibot();
|
||||
const int centeredThreshold = 100;
|
||||
const int centeredThreshold = 50 ;
|
||||
|
||||
void setup() {
|
||||
// put your setup code here, to run once:
|
||||
@ -17,29 +17,29 @@ void loop() {
|
||||
//correct Stearing to be centered
|
||||
if( abs(leftValue-rightValue)
|
||||
< centeredThreshold){
|
||||
dezibot.motion.move(1);
|
||||
dezibot.motion.move();
|
||||
}else{
|
||||
if (leftValue > rightValue){
|
||||
dezibot.motion.rotateAnticlockwise(1);
|
||||
dezibot.motion.rotateAntiClockwise();
|
||||
} else{
|
||||
dezibot.motion.rotateClockwise(1);
|
||||
dezibot.motion.rotateClockwise();
|
||||
}
|
||||
}
|
||||
dezibot.multiColorLight.setTopLeds(BLUE);
|
||||
break;
|
||||
case IR_LEFT:
|
||||
dezibot.motion.rotateAnticlockwise(1);
|
||||
dezibot.motion.rotateAntiClockwise();
|
||||
dezibot.multiColorLight.setTopLeds(RED);
|
||||
break;
|
||||
case IR_RIGHT:
|
||||
dezibot.motion.rotateClockwise(1);
|
||||
dezibot.motion.rotateClockwise();
|
||||
dezibot.multiColorLight.setTopLeds(GREEN);
|
||||
break;
|
||||
case IR_BACK:
|
||||
if(leftValue > rightValue){
|
||||
dezibot.motion.rotateAnticlockwise(1);
|
||||
dezibot.motion.rotateAntiClockwise();
|
||||
} else {
|
||||
dezibot.motion.rotateClockwise(1);
|
||||
dezibot.motion.rotateClockwise();
|
||||
}
|
||||
dezibot.multiColorLight.setTopLeds(YELLOW);
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user