Implementiere USB-MIDI-Controller für Arduino Pro Micro mit Hardware- und Software-Architektur, einschließlich Button- und LED-Steuerung, Multiplexer-Integration und MIDI-Kommunikation.
This commit is contained in:
21
include/multiplexer.h
Normal file
21
include/multiplexer.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#ifndef MULTIPLEXER_H
|
||||
#define MULTIPLEXER_H
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
class Multiplexer {
|
||||
private:
|
||||
uint8_t s0, s1, s2, s3;
|
||||
uint8_t analogPin;
|
||||
int lastValues[16];
|
||||
unsigned long lastReadTime[16];
|
||||
|
||||
public:
|
||||
Multiplexer(uint8_t s0Pin, uint8_t s1Pin, uint8_t s2Pin, uint8_t s3Pin, uint8_t analogPin);
|
||||
void init();
|
||||
int readChannel(uint8_t channel);
|
||||
bool hasChanged(uint8_t channel, int threshold = 4);
|
||||
void selectChannel(uint8_t channel);
|
||||
};
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user