Using the ardumidi.h library included with hairless bridge I get the error pointed at in the title plus an IDE Error stating:
"C:\Users\Utente\Documents\Arduino\libraries\ardumidi\ardumidi.cpp: In function 'void midi_command(byte, byte, byte, byte)':
C:\Users\Utente\Documents\Arduino\libraries\ardumidi\ardumidi.cpp:59:43: error: 'BYTE' was not declared in this scope
Serial.print(command | (channel & 0x0F), BYTE);
^~~~
C:\Users\Utente\Documents\Arduino\libraries\ardumidi\ardumidi.cpp: In function 'void midi_command_short(byte, byte, byte)':
C:\Users\Utente\Documents\Arduino\libraries\ardumidi\ardumidi.cpp:66:43: error: 'BYTE' was not declared in this scope
Serial.print(command | (channel & 0x0F), BYTE);
^~~~
C:\Users\Utente\Documents\Arduino\libraries\ardumidi\ardumidi.cpp: In function 'void midi_print(char*, int)':
C:\Users\Utente\Documents\Arduino\libraries\ardumidi\ardumidi.cpp:72:21: error: 'BYTE' was not declared in this scope
Serial.print(0xFF, BYTE);
^~~~
exit status 1
Compilation error: exit status 1"
Here's the code:
#include <ardumidi.h>
// Wiring
const int potPin1 = A0; // Potentiometer 1
const int potPin2 = A1; // Potentiometer 2
const int buttonPin1 = 2; // Button 1
const int buttonPin2 = 3; // Button 2
const int ledPin = 4; // LED
void setup() {
// Com. Seriale
Serial.begin(115200);
// Bottoni Pull-Up
pinMode(buttonPin1, INPUT_PULLUP);
pinMode(buttonPin2, INPUT_PULLUP);
// LED
pinMode(ledPin, OUTPUT);
}
void loop() {
// Lettura Valori Pot.
int potValue1 = analogRead(potPin1);
int potValue2 = analogRead(potPin2);
//Scalatura
int MIDIPot1 = map(potValue1, 0, 1023, 0, 127);
int MIDIPot2 = map(potValue2, 0, 1023, 0, 127);
// Status Bottoni
int buttonState1 = digitalRead(buttonPin1);
int buttonState2 = digitalRead(buttonPin2);
// Controllo LED relativo a Bottone
if (buttonState1 == HIGH) {
digitalWrite(ledPin, HIGH); // LED On
} else {
digitalWrite(ledPin, LOW); // LED Off
}
// Invio MIDI
if (buttonState1 == 1) {
midi_note_on(0, 60, 127);
} else {
midi_note_off(0, 60, 0);
}
if (buttonState2 == 1) {
midi_note_on(0, 64, 127);
} else {
midi_note_off(0, 64, 0);
}
midi_controller_change(0, 1, MIDIPot1);
midi_controller_change(0, 2, MIDIPot2);
// Delay
delay(20);
}
I've been digging for days, reading stuff, I can't make it work and my exam is due in a week. Please, help me!