Hi guys
I'm working on a MIDI controller based on an arduino nano every, which is suppose to control an external unit through CC messages.
But it is not working
I think I build up everything in right way, but the thing is not working:
- schematics is OK
- connections are good
- board is working
- code is fine and uploaded
- receiving unit is correctly set
this is the schematics and the code.
Any idea ? How can I check if the midi CC are really sent and going out the midi port ?
#include <MIDI.h>
MIDI_CREATE_DEFAULT_INSTANCE();
int waitforit = 300;
int midiChannel = 1;
#define BUTTON_PIN_1 3
#define BUTTON_PIN_2 2
#define BUTTON_PIN_3 4
#define BUTTON_PIN_4 5
#define led_g 10
#define led_b 9
#define led_r 8
void setup() {
MIDI.begin(MIDI_CHANNEL_OMNI);
pinMode(BUTTON_PIN_1, INPUT_PULLUP);
pinMode(BUTTON_PIN_2, INPUT_PULLUP);
pinMode(BUTTON_PIN_3, INPUT_PULLUP);
pinMode(BUTTON_PIN_4, INPUT_PULLUP);
pinMode(led_r, OUTPUT);
pinMode(led_g, OUTPUT);
pinMode(led_b, OUTPUT);
digitalWrite(led_r, HIGH );
//Serial.begin(9600); // NB Serial monitor confligge con MIDI
}
void loop() {
digitalWrite(led_r, HIGH );
if (digitalRead(BUTTON_PIN_1) == LOW ) { sceneA(); }
if (digitalRead(BUTTON_PIN_2) == LOW ) { sceneB(); }
if (digitalRead(BUTTON_PIN_3) == LOW ) { sceneC(); }
if (digitalRead(BUTTON_PIN_4) == LOW ) { sceneD(); }
/*
// monitor buttons ( NB Serial monitor confligge con MIDI)
Serial.print(digitalRead(BUTTON_PIN_1));
Serial.print(digitalRead(BUTTON_PIN_2));
Serial.print(digitalRead(BUTTON_PIN_3));
Serial.println(digitalRead(BUTTON_PIN_4));
delay(100);
*/
}
// ------------------------------------------------------------
// -- FUNZIONI IN USO
void sceneA(){
digitalWrite(led_r, LOW );
digitalWrite(led_b, HIGH );
MIDI.sendControlChange (43, 0, midiChannel); // vedi manuale Quad Cortex
delay(waitforit);
digitalWrite(led_r, HIGH );
digitalWrite(led_b, LOW );
}
void sceneB(){
digitalWrite(led_r, LOW );
digitalWrite(led_b, HIGH );
MIDI.sendControlChange (43, 1, midiChannel); // vedi manuale Quad Cortex
delay(waitforit);
digitalWrite(led_r, HIGH );
digitalWrite(led_b, LOW );
}
void sceneC(){
digitalWrite(led_r, LOW );
digitalWrite(led_b, HIGH );
MIDI.sendControlChange (43, 2, midiChannel); // vedi manuale Quad Cortex
delay(waitforit);
digitalWrite(led_r, HIGH );
digitalWrite(led_b, LOW );
}
void sceneD(){
digitalWrite(led_r, LOW );
digitalWrite(led_b, HIGH );
MIDI.sendControlChange (43, 3, midiChannel); // vedi manuale Quad Cortex
delay(waitforit);
digitalWrite(led_r, HIGH );
digitalWrite(led_b, LOW );
}