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.

60 lines
1.1 KiB

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. long timer;
  5. void inline clearCommands() {
  6. for(uint8_t i=0; i<32; i++) {
  7. commands[i] = 0xFF;
  8. }
  9. }
  10. void setup() {
  11. remoteControlInit();
  12. funkInit();
  13. Serial.begin(115200);
  14. driveTimeout = 10;
  15. joystickInit(); //TODO
  16. clearCommands();
  17. //Temperatur- und Abstandsmessung
  18. tempDistSetup();
  19. setEchoPins(0, 0); //Setze die pins für den Abstandsensor aus denen gelesenw erden soll das erster ist der Trigger-, das zweite der Echopin
  20. timer = millis();
  21. }
  22. void loop() {
  23. //lcdMenu();
  24. while(!tasten.getButtonCycle(buttonStart)) {
  25. manualDigitalDrive();
  26. }
  27. tasten.clearButton(buttonStart);
  28. while(!tasten.getButtonCycle(buttonStart)){
  29. motorMapping();
  30. }
  31. tasten.clearButton(buttonStart);
  32. while(!tasten.getButtonCycle(buttonStart)){
  33. joystickSteuerung(); //TODO ()
  34. }
  35. tasten.clearButton(buttonStart);
  36. //Temperatur- und Abstandsmessung
  37. /*
  38. temperature = dallas(4, 0);
  39. if(millis() - timer >= 100){
  40. measureDistance();
  41. timer = millis();
  42. }
  43. distance = calculateDistance();
  44. */
  45. }
  46. void lcdMenu() {
  47. lcd.println("Platzhalter");
  48. }