Refactor code substantially, moving buttons into separate classes and using a lot more pointers to conserve memory until it is needed.
This commit is contained in:
@ -5,7 +5,7 @@
|
||||
#include <Joystick.h>
|
||||
#include <Mux.h>
|
||||
|
||||
using admux::Pinset;
|
||||
using namespace admux;
|
||||
|
||||
bool debug = false;
|
||||
Joystick joystick(debug);
|
||||
@ -26,7 +26,9 @@ void setup() {
|
||||
Pinset addr_pins = Pinset(10, 11, 12, 13);
|
||||
uint8_t mux_id = joystick.AddMux(9, addr_pins);
|
||||
|
||||
joystick.AddMuxButton(mux_id, 0, BUTTON_PASSTHRU);
|
||||
Mux* mux = new Mux(Pin(9, INPUT_PULLUP, PinType::Digital), Pinset(10, 11, 12, 13));
|
||||
|
||||
joystick.AddButton(0, BUTTON_PASSTHRU, true, mux);
|
||||
|
||||
// start up serial communication
|
||||
joystick.Init();
|
||||
|
Reference in New Issue
Block a user