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.

42 lines
1.1 KiB

  1. #include <Steuerung.h>
  2. //Informationen Joystick
  3. Joystick *joystick;
  4. const uint16_t xAxisPin = 5;
  5. const uint16_t yAxisPin = 4;
  6. const int16_t lowestJoystickValue = 0;
  7. const int16_t highestJoystickValue = 511;
  8. const int16_t spaceing = 50;
  9. //Informationen linker Motor
  10. Motor *left;
  11. const int16_t lowestPWMValueLeftMotor = -255;
  12. const int16_t highestPWMValueLeftMotor = 255;
  13. //Informationen rechter Motor
  14. Motor *right;
  15. const int16_t lowestPWMValueRightMotor = -255;
  16. const int16_t highestPWMValueRightMotor = 255;
  17. Steuerung *steuerung;
  18. void setup() {
  19. joystick = new Joystick(xAxisPin, yAxisPin, lowestJoystickValue, highestJoystickValue, spaceing);
  20. left = new Motor(lowestPWMValueLeftMotor, highestPWMValueLeftMotor);
  21. right = new Motor(lowestPWMValueRightMotor, highestPWMValueRightMotor);
  22. steuerung = new Steuerung(joystick, left, right);
  23. Serial.begin(9600);
  24. }
  25. void loop() {
  26. steuerung -> updateValues();
  27. //DEBUG
  28. Serial.print("Left motor PWMValue: ");
  29. Serial.println(left -> PWMValue);
  30. Serial.print("Right motor PWMValue: ");
  31. Serial.println(right -> PWMValue);
  32. //SendValues
  33. delay(500);
  34. }