From 416b2a17303b5ab441dd05cbf4d714c9613cff0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20St=C3=A4ck?= Date: Tue, 25 Jun 2019 13:20:40 +0200 Subject: [PATCH] Restructure and clarify defined constants --- NuEVI/NuEVI.ino | 27 ++++++++++++++++++++------- NuEVI/hardware.h | 17 ++++++++++------- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/NuEVI/NuEVI.ino b/NuEVI/NuEVI.ino index ae57791..ad918e6 100644 --- a/NuEVI/NuEVI.ino +++ b/NuEVI/NuEVI.ino @@ -25,6 +25,18 @@ PROGRAMME FUNCTION: EVI Wind Controller using the Freescale MP3V5004GP breath */ +//Make sure compiler is set to the appropriate platform +#ifndef __MK20DX256__ + #error "Wrong target platform. Please set to Teensy 3.1/3.2 (MK20DX256)." +#endif + +#if !defined(USB_MIDI) && !defined(USB_MIDI_SERIAL) + #error "USB MIDI not enabled. Please set USB type to 'MIDI' or 'Serial + MIDI'." +#endif + + + + // The three states of our main state machine // No note is sounding @@ -38,14 +50,15 @@ PROGRAMME FUNCTION: EVI Wind Controller using the Freescale MP3V5004GP breath // A note is sounding #define NOTE_ON 3 -//Make sure compiler is set to the appropriate platform -#ifndef __MK20DX256__ - #error "Wrong target platform. Please set to Teensy 3.1/3.2 (MK20DX256)." -#endif -#if !defined(USB_MIDI) && !defined(USB_MIDI_SERIAL) - #error "USB MIDI not enabled. Please set USB type to 'MIDI' or 'Serial + MIDI'." -#endif +//Magic value where pinky button means "pitch bend" +#define PBD 12 + +//Vibrato direction +#define UPWD 1 +#define DNWD 0 + + //_______________________________________________________________________________________________ DECLARATIONS diff --git a/NuEVI/hardware.h b/NuEVI/hardware.h index 3b9c64a..965b636 100644 --- a/NuEVI/hardware.h +++ b/NuEVI/hardware.h @@ -10,37 +10,40 @@ #define specialKeyPin 0 // SK or S2 #define halfPitchBendKeyPin 1 // PD or S1 + +//Capacitive sensor pins (on-board teensy) #define bitePin 17 #define extraPin 16 #define pbUpPin 23 #define pbDnPin 22 #define vibratoPin 15 +//Pins jumpered to enable bite pressure sensor +#define biteJumperPin 11 +#define biteJumperGndPin 12 -#define biteJumperPin 11 //PBITE -#define biteJumperGndPin 12 //PBITE - +//Analog pressure sensors. Breath and optional bite #define breathSensorPin A0 #define bitePressurePin A7 +//Digital pins for menu buttons #define dPin 3 #define ePin 4 #define uPin 5 #define mPin 6 +//Output pins for LEDs (breath, power, status) #define bLedPin 10 #define pLedPin 9 #define statusLedPin 13 +//Analog input for measuring voltage #define vMeterPin A11 +//DAC outputs for analog and pwm #define dacPin A14 #define pwmDacPin 20 -#define PBD 12 -#define UPWD 1 -#define DNWD 0 - //Which serial port to use for MIDI #define MIDI_SERIAL Serial3