You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Good afternoon, Tttapa, I want to connect an analog ButtonKeypad (via USB MIDI library) and a rotary encoder (from your library).
But I get the error analogRead - "call of overloaded 'analogRead(const uint8_t&)' is ambiguous".
How can I connect this keyboard?
Robotdyn.com/Mod-ButtonKeypad4x4-EN
Description of the problem or question
Steps to reproduce the problem
Hardware:
Arduino board: Arduino Leonardo
Software versions:
MIDI Controller library: 3.1.0 Arduino IDE: 1.8.7 Operating System: Windows Operating System version: 10
Settings in the IDE
Full code
// Your code here
#defineUSE_ROTARY_ENCODER
#include<MIDI.h>
#include"MIDIUSB.h"
#include<MIDI_Controller.h>//Constants
RotaryEncoder encoder5(10, 11, 0x0B, 1, 1, NORMAL_ENCODER, TWOS_COMPLEMENT);
RotaryEncoder encoder6(12, 13, 0x0C, 1, 1, NORMAL_ENCODER, TWOS_COMPLEMENT);
voidnoteOn(byte channel, byte pitch, byte velocity) {
midiEventPacket_t noteOn = {0x09, 0x90 | channel, pitch, velocity};
MidiUSB.sendMIDI(noteOn);
}
//Variablesint buttonValue; //Stores analog value when button is pressedvoidsetup()
{
Serial.begin(31250);
}
voidloop()
{
buttonValue = analogRead(A0); //Read analog value from A0 pin//For 1st button:if (buttonValue>=538 && buttonValue<=540){
noteOn(0,36,127);
MidiUSB.flush();
}
//For 2nd button:elseif (buttonValue>=510 && buttonValue<=513){
noteOn(0,37,127);
MidiUSB.flush();
}
//For 3rd button:elseif (buttonValue>=487 && buttonValue<=488){
noteOn(0,38,127);
MidiUSB.flush();
}
//For 4th button:elseif (buttonValue>=638 && buttonValue<=639){
noteOn(0,39,127);
MidiUSB.flush();
}
//For 5th button:elseif (buttonValue>=601 && buttonValue<=602){
noteOn(0,40,127);
MidiUSB.flush();
}
//For 6th button:elseif (buttonValue>=568 && buttonValue<=569){
noteOn(0,41,127);
MidiUSB.flush();
}
//For 7th button:elseif (buttonValue>=787 && buttonValue<=789){
noteOn(0,42,127);
MidiUSB.flush();
}
//For 8th button:elseif (buttonValue>=732 && buttonValue<=733){
noteOn(0,43,127);
MidiUSB.flush();
}
//For 9th button:elseif (buttonValue>=683 && buttonValue<=684){
noteOn(0,44,127);
MidiUSB.flush();
}
//For 10th button:elseif (buttonValue>=1022 && buttonValue<=1023){
noteOn(0,45,127);
MidiUSB.flush();
}
//For 11th button:elseif (buttonValue>=931 && buttonValue<=933){
noteOn(0,46,127);
MidiUSB.flush();
}
//For 12th button:elseif (buttonValue>=853 && buttonValue<=855){
noteOn(0,47,127);
MidiUSB.flush();
}
delay(400);
}
## Steps taken to try to diagnose or solve the problem
? Tried the MIDI debug mode, used a MIDI monitor, ... ?
## The goal of your project and aditional information
The text was updated successfully, but these errors were encountered:
santta
changed the title
connect an analog matrix keyboard
connect analog matrix keyboard
Nov 30, 2018
santta
changed the title
connect analog matrix keyboard
connect analog matrix ButtonKeypad
Nov 30, 2018
Good afternoon, Tttapa, I want to connect an analog ButtonKeypad (via USB MIDI library) and a rotary encoder (from your library).
But I get the error analogRead - "call of overloaded 'analogRead(const uint8_t&)' is ambiguous".
How can I connect this keyboard?
Robotdyn.com/Mod-ButtonKeypad4x4-EN
Description of the problem or question
Steps to reproduce the problem
Hardware:
Arduino board: Arduino Leonardo
Software versions:
MIDI Controller library: 3.1.0
Arduino IDE: 1.8.7
Operating System: Windows
Operating System version: 10
Settings in the IDE
Full code
The text was updated successfully, but these errors were encountered: