- Create class 'evaluatedJoystick' - evaluates a joystick with 2 analog signals - scales the adc input to coordinates with detailed tolerances - calculates angle and radius - defines an enum with position information - Add joystick configuration and class instance to config.cpp - Add code for testing the new class to main.cpp - Add joystick.cpp to cmakelists now function `joystick.getData` can be used globally to obtain a struct with current position data of the joystick
12 lines
252 B
C++
12 lines
252 B
C++
#pragma once
|
|
|
|
#include "motordrivers.hpp"
|
|
#include "motorctl.hpp"
|
|
#include "joystick.hpp"
|
|
|
|
//create global controlledMotor instances for both motors
|
|
extern controlledMotor motorLeft;
|
|
|
|
//create global joystic instance
|
|
extern evaluatedJoystick joystick;
|