mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-28 21:50:35 +00:00
* 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>
29 lines
575 B
C++
29 lines
575 B
C++
#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 |