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.5 KiB

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