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.

17 lines
602 B

  1. #include "Joystick.h"
  2. Joystick::Joystick(uint16_t x_pin, uint16_t y_pin, int16_t lowestValue, int16_t highestValue, uint16_t spaceing) {
  3. this -> x_pin = x_pin;
  4. this -> y_pin = y_pin;
  5. this -> lowestValue = lowestValue;
  6. this -> highestValue = highestValue;
  7. this -> spaceing = spaceing;
  8. }
  9. void Joystick::checkJoystickInput() {
  10. this -> xAxisReading = analogRead(x_pin);
  11. this -> yAxisReading = analogRead(y_pin);
  12. //9-bit reichen, der ADC schafft bestenfalls 8-bit praezision
  13. (this -> xAxisReading) = (this -> xAxisReading) >> 1;
  14. (this -> yAxisReading) = (this -> yAxisReading) >> 1;
  15. }