Ein Roboter mit bürstenlosem Antrieb, differenzial und NRF24L01 Funk. Großflächig gebaut um ein großes Solarpanel aufzunehmen.
https://gitlab.informatik.hs-fulda.de/fdai5253/roboter
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.3 KiB
49 lines
1.3 KiB
void manualDigitalDrive() {
|
|
|
|
bool goOn = false;
|
|
clearCommands();
|
|
if(!tasten.getAnyPressed()) {
|
|
lcdLines[0] = "Warte...";
|
|
lcdLines[1] = "";
|
|
|
|
}
|
|
if(tasten.checkButton(buttonB) || tasten.checkButton(buttonUp)) {
|
|
pwmA = -215;
|
|
pwmB = -255;
|
|
lcdLines[0] = "geradeaus fahren";
|
|
goOn =true;
|
|
}
|
|
if(tasten.checkButton(buttonC) || tasten.checkButton(buttonDown)) {
|
|
pwmA = 100;
|
|
pwmB = 255;
|
|
lcdLines[0] = "rueckwaerts fahren";
|
|
goOn =true;
|
|
}
|
|
if(tasten.checkButton(buttonRight)) {
|
|
pwmA = -100; //rechter Motor
|
|
pwmB = 100;
|
|
lcdLines[0] = "rechts lenken";
|
|
goOn =true;
|
|
}
|
|
if(tasten.checkButton(buttonLeft)) {
|
|
pwmB = -100;
|
|
pwmA = 100;
|
|
lcdLines[0] = "links lenken";
|
|
goOn =true;
|
|
}
|
|
if(goOn) {
|
|
commands[0] = speedA;
|
|
commands[1] = highByte(pwmA);
|
|
commands[2] = lowByte(pwmA);
|
|
commands[3] = speedB;
|
|
commands[4] = highByte(pwmB);
|
|
commands[5] = lowByte(pwmB);
|
|
commands[6] = timeToDrive;
|
|
commands[7] = highByte(driveTimeout);
|
|
commands[8] = lowByte(driveTimeout);
|
|
commands[9] = goDrive;
|
|
|
|
radio.write(&commands, sizeof(commands));
|
|
goOn = false;
|
|
}
|
|
}
|