-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJoystick.h
38 lines (35 loc) · 984 Bytes
/
Joystick.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef Joystick_h
#define Joystick_h
#include "Arduino.h"
class Joystick
{
private:
const int m_minAnalogRange = 0;
const int m_maxAnalogRange = 1023;
int m_joystickLowLimit;
int m_joystickHighLimit;
uint8_t m_pinJoystickButton;
uint8_t m_pinJoystickX;
uint8_t m_pinJoystickY;
int m_XValue;
int m_YValue;
int m_minRange;
int m_maxRange;
bool m_buttonValue;
int m_noActionLimit;
bool m_XAxisInverted;
bool m_YAxisInverted;
public:
Joystick(uint8_t pinJoystickX, uint8_t pinJoystickY, uint8_t pinJoystickButton, int noActionLimit, int minRange, int maxRange);
int getXValue();
int getYValue();
bool getbuttonValue();
int getLowLimit();
int getHighLimit();
int getNoActionLimit();
void invertXAxis();
void invertYAxis();
String toString();
void toSerial();
};
#endif