Files
GravityFW/Software/Gravity/config.h
2025-03-11 14:58:42 +02:00

41 lines
1.1 KiB
C

#pragma once
#define PPQN 24
#define PULSE_LENGTH 120 //1/10ms resolution. 12ms was failing at 1ms resolution at higher bpm. 60000/200/24 = 12.5 the max pulse length at 1ms resolution for 200bpm is 11ms
#define MAXBPM 200 //250 at 24ppqn with 5ms pulse will be 50/50 square wave
#define MINBPM 20
#define SCREEN_ADDRESS 0x3C
// Rev 2+ Config
#define ENC_BTN_PIN 14
#define ENC_D1_PIN 17
#define ENC_D2_PIN 4
#define START_STOP_BTN_PIN 5
#define SHIFT_BTN_PIN 12
#define EXT_INPUT_PIN 2 //needs to be an interrupt pin
#define ANALOGUE_INPUT_1_PIN A7
#define ANALOGUE_INPUT_2_PIN A6
const byte clockOutPin = 3;
const byte outsPins[] = { 7, 8, 10, 6, 9, 11, clockOutPin };
bool rotateScreen = false;
bool reverseEnc = false;
//
/* Rev 1 Config
#define ENC_BTN_PIN 14
#define ENC_D1_PIN 17
#define ENC_D2_PIN 4
#define START_STOP_BTN_PIN 5
#define SHIFT_BTN_PIN 100
#define EXT_INPUT_PIN 2 //needs to be an interrupt pin
#define ANALOGUE_INPUT_1_PIN A2
#define ANALOGUE_INPUT_2_PIN A1
const byte clockOutPin = 13;
const byte outsPins[6] = {6, 11, 7, 10, 8, 9};
bool rotateScreen = true;
*/
#define bitFlip(value, bit) ((value) ^ (1UL << (bit)))