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.

63 lines
1.2 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. #include <avr/interrupt.h>
  2. #include <avr/io.h>
  3. #include <Arduino.h>
  4. void inline clearCommands() {
  5. for(uint8_t i=0; i<32; i++) {
  6. commands[i] = 0xFF;
  7. }
  8. }
  9. void setup() {
  10. remoteControlInit();
  11. funkInit();
  12. Serial.begin(115200);
  13. driveTimeout = 10;
  14. joystickInit(); //TODO
  15. clearCommands();
  16. renderTime = millis();
  17. }
  18. void loop() {
  19. //lcdMenu();
  20. while(!tasten.getButtonCycle(buttonStart)) {
  21. manualDigitalDrive();
  22. updateTemp();
  23. String temp_str = "T: " + String(temperature) + " Grad C";
  24. lcdLines[5] = temp_str;
  25. refreshLCD();
  26. }
  27. tasten.clearButton(buttonStart); /*
  28. while(!tasten.getButtonCycle(buttonStart)){
  29. motorMapping();
  30. //updateTemp();
  31. refreshLCD();
  32. }
  33. tasten.clearButton(buttonStart); */
  34. while(!tasten.getButtonCycle(buttonStart)){
  35. joystickSteuerung(); //TODO ()
  36. //updateTemp();
  37. refreshLCD();
  38. }
  39. tasten.clearButton(buttonStart);
  40. }
  41. void lcdMenu() {
  42. lcd.println("Platzhalter");
  43. }
  44. void refreshLCD() {
  45. if((millis() - renderTime) >= renderTimeout) {
  46. lcd.clear();
  47. for(uint8_t i = 0; i < sizeof(lcdLines); i++) {
  48. lcd.gotoXY(0, i);
  49. lcd.print(lcdLines[i]);
  50. }
  51. lcd.renderAll();
  52. renderTime = millis();
  53. }
  54. }