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.

65 lines
1.5 KiB

4 years ago
4 years ago
4 years ago
  1. #include <PCD8544_SPI.h>
  2. #include <shiftRegButtonLib.h>
  3. #include <myInterrupts.h>
  4. #define CLR_BIT(p,n) ((p) &= ~((1) << (n)))
  5. #define SET_BIT(p,n) ((p) |= (1 << (n)))
  6. #define BL 10 //backlight, Hintergrundbeleuchtung LCD
  7. #define SD_CARD_CS 2 //D2 ist Chip Enable
  8. #define BAT_VOLTAGE A7 //Akkuspannung an A7
  9. #define _OE_LEVEL 7 //D7 fuer Output Enable Pegelwandler
  10. #define BRIGHTNESS OCR1B
  11. //globale Objekte anlegen
  12. volatile PCD8544_SPI lcd;
  13. volatile myInterrupts Timer2;
  14. volatile myInterrupts pwmBL;
  15. volatile shiftRegButton tasten;
  16. //Kommandos
  17. #define nothing 9 //reset/nichts tun
  18. #define speedA 1 // set speed A + speed
  19. #define dirA 2 // set direction A + dir
  20. #define speedB 3 // set speed B + speed
  21. #define dirB 4 // set direction B + dir
  22. #define goDrive 5 //go + time to go
  23. #define stopDrive 6 //stop
  24. #define getTemp 7 //get temperature
  25. #define timeToDrive 8 //Zeitdauer des fahrens
  26. int pwmA = 0;
  27. int pwmB = 0;
  28. bool forwardA = true;
  29. bool forwardB = true;
  30. bool driveOn = false;
  31. uint16_t driveTimeout = 0;
  32. //Funk
  33. #include <SPI.h>
  34. #include <nRF24L01.h>
  35. #include <RF24.h>
  36. RF24 radio(A2, A3); // CE, CSN
  37. const byte address[6] = "00001";
  38. uint8_t commands[32];
  39. /*
  40. const String mainMenu[] = {
  41. "fahren", //0
  42. "stoppen", //1
  43. "manuell fahren", //2
  44. "", //3
  45. "", //4
  46. "", //5
  47. "", //6
  48. "", //7
  49. "", //8
  50. "" //9
  51. };
  52. const String subMenuEntry0[] = {
  53. "Zeitdauer",
  54. "Speed A",
  55. "Speed B",
  56. "Starten"
  57. }; */