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

#include "Joystick.h"
Joystick::Joystick(uint16_t x_pin, uint16_t y_pin, int16_t lowestValue, int16_t highestValue, uint16_t spaceing) {
this -> x_pin = x_pin;
this -> y_pin = y_pin;
this -> lowestValue = lowestValue;
this -> highestValue = highestValue;
this -> spaceing = spaceing;
}
void Joystick::checkJoystickInput() {
this -> xAxisReading = analogRead(x_pin);
this -> yAxisReading = analogRead(y_pin);
//9-bit reichen, der ADC schafft bestenfalls 8-bit praezision
(this -> xAxisReading) = (this -> xAxisReading) >> 1;
(this -> yAxisReading) = (this -> yAxisReading) >> 1;
}