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

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. void manualDigitalDrive() {
  2. bool goOn = false;
  3. clearCommands();
  4. if(!tasten.getAnyPressed()) {
  5. lcdLines[0] = "Warte...";
  6. lcdLines[1] = "";
  7. }
  8. if(tasten.checkButton(buttonB) || tasten.checkButton(buttonUp)) {
  9. pwmA = -215;
  10. pwmB = -255;
  11. lcdLines[0] = "geradeaus fahren";
  12. goOn =true;
  13. }
  14. if(tasten.checkButton(buttonC) || tasten.checkButton(buttonDown)) {
  15. pwmA = 100;
  16. pwmB = 255;
  17. lcdLines[0] = "rueckwaerts fahren";
  18. goOn =true;
  19. }
  20. if(tasten.checkButton(buttonRight)) {
  21. pwmA = -100; //rechter Motor
  22. pwmB = 100;
  23. lcdLines[0] = "rechts lenken";
  24. goOn =true;
  25. }
  26. if(tasten.checkButton(buttonLeft)) {
  27. pwmB = -100;
  28. pwmA = 100;
  29. lcdLines[0] = "links lenken";
  30. goOn =true;
  31. }
  32. if(goOn) {
  33. commands[0] = speedA;
  34. commands[1] = highByte(pwmA);
  35. commands[2] = lowByte(pwmA);
  36. commands[3] = speedB;
  37. commands[4] = highByte(pwmB);
  38. commands[5] = lowByte(pwmB);
  39. commands[6] = timeToDrive;
  40. commands[7] = highByte(driveTimeout);
  41. commands[8] = lowByte(driveTimeout);
  42. commands[9] = goDrive;
  43. radio.write(&commands, sizeof(commands));
  44. goOn = false;
  45. }
  46. }