mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-04 17:11:01 +00:00
Seesaw Rotary (#7310)
* Initial add of Adafruit seesaw encoder * Fully wire up seesaw * Trunk * Add #include configuration.h back to unbreak logging * Tryfix the dumb compilation error --------- Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
29
src/input/SeesawRotary.h
Normal file
29
src/input/SeesawRotary.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
#ifdef ARCH_PORTDUINO
|
||||
|
||||
#include "Adafruit_seesaw.h"
|
||||
#include "InputBroker.h"
|
||||
#include "concurrency/OSThread.h"
|
||||
#include "configuration.h"
|
||||
|
||||
#define SS_SWITCH 24
|
||||
#define SS_NEOPIX 6
|
||||
|
||||
#define SEESAW_ADDR 0x36
|
||||
|
||||
class SeesawRotary : public Observable<const InputEvent *>, public concurrency::OSThread
|
||||
{
|
||||
public:
|
||||
const char *_originName;
|
||||
bool init();
|
||||
SeesawRotary(const char *name);
|
||||
int32_t runOnce() override;
|
||||
|
||||
private:
|
||||
Adafruit_seesaw ss;
|
||||
int32_t encoder_position;
|
||||
bool wasPressed = false;
|
||||
};
|
||||
|
||||
extern SeesawRotary *seesawRotary;
|
||||
#endif
|
||||
Reference in New Issue
Block a user