46 lines
870 B
C++
46 lines
870 B
C++
/*
|
|
Macro Board
|
|
Made by Bozarre
|
|
*/
|
|
|
|
/*
|
|
* saving presets in eeprom
|
|
*/
|
|
#include <EEPROM.h>
|
|
|
|
/*
|
|
* 7 Segment 4 digits display
|
|
*/
|
|
#include "SevSeg.h"
|
|
SevSeg sevseg;
|
|
|
|
/*
|
|
* key button matrix
|
|
*/
|
|
#include <Key.h>
|
|
#include <Keypad.h>
|
|
|
|
const byte rows = 4; //four rows
|
|
const byte cols = 3; //three columns
|
|
char keys[rows][cols] = { // assiging arbitraty uid to each button
|
|
{1,5,9},
|
|
{2,6,10},
|
|
{3,7,11},
|
|
{4,8,12}
|
|
};
|
|
byte rowPins[rows] = {1, 2, 3, 0}; //connect to the row pinouts of the keypad
|
|
byte colPins[cols] = {21, 22, 23}; //connect to the column pinouts of the keypad
|
|
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, rows, cols );
|
|
|
|
/*
|
|
* Rotary Encoder
|
|
*/
|
|
#include <SimpleRotary.h>
|
|
|
|
SimpleRotary rotaryEncoder(19, 20, 4);
|
|
byte rotaryEncoderState = 0;
|
|
|
|
// Rotary push button
|
|
const int BUTTON_Rotary = 4;
|
|
bool BUTTON_Rotary_lastState = HIGH;
|