-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathMultiplexer.h
43 lines (35 loc) · 1.23 KB
/
Multiplexer.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
39
40
41
42
43
#ifndef MULTIPLEXER_H
#define MULTIPLEXER_H
#include <Arduino.h>
#include "src/Joystick.h" // Include the Joystick class header file
class Multiplexer {
private:
Joystick_* joystick; // Pointer to a Joystick object
// variables for button pin states
uint16_t iYokeButtonPinStates = 0;
uint16_t iSensorPinStates = 0;
// Pointers to end switch states
bool blEndSwitchRollLeft;
bool blEndSwitchRollRight;
bool blEndSwitchPitchUp;
bool blEndSwitchPitchDown;
bool blCalubrationButtonPushed;
bool blMotorPower;
public:
// Constructor: pass a pointer to a Joystick object
//Multiplexer(Joystick_* joystickPtr, bool* rollLeft, bool* rollRight, bool* pitchUp, bool* pitchDown);
Multiplexer(Joystick_* joystickPtr);
// Method to read from the multiplexer and update end switches
void ReadMux();
// Method to update the joystick buttons based on multiplexer state
void UpdateJoystickButtons();
bool EndSwitchRollLeft();
bool EndSwitchRollRight();
bool EndSwitchPitchUp();
bool EndSwitchPitchDown();
bool CalibrationButtonPushed();
bool MotorPower();
uint16_t GetYokeButtonPinStates();
uint16_t GetSensorPinStates();
};
#endif