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.

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