Replies: 1 comment
-
Hi, For the pots have a look here on the basics: https://docs.arduino.cc/learn/electronics/potentiometer-basics/ For the encoders it depends on what you want to do. There exist easy to us libraries for reading the encoders and then you could send CC's etc? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi There,
I'm building a bluetooth midi controller using my ESP32-S3 board- spoiler alert, I am a hobbyist so my knowledge is limited at best.
The controller I'm building needs to send midi signal from 2x buttons, 2x B10K potentiometers and 2x rotary encoders. So far I have managed to get the bluetooth midi connection working fine and the 2 buttons are sending midi over bluetooth successfully, but I'm completely at a loss on how to code the pots and the rotary encoders. Could anyone assist me with this?
BOARD USED: ESP32-S3
POT1 PIN: 4
POT2 PIN: 5
BUTTON1 PIN: 6
BUTTON2 PIN: 7
ROTARY1a PIN: 15
ROTARY1b PIN: 16
ROTARY2a PIN: 17
ROTARY2b PIN: 18
Any help would be massively appreciated!
Here's my current code that includes the 2x buttons:
`#include <BLEMIDI_Transport.h>
#include <hardware/BLEMIDI_ESP32.h>
//BLEMIDI_CREATE_DEFAULT_INSTANCE()
BLEMIDI_CREATE_INSTANCE("FAM_INSTRUMENT", MIDI)
const int btnPin1 = 6;
const int btnPin2 = 7;
int midiNote;
int btnState;
int lastBtnState;
void setup() {
pinMode(btnPin1, INPUT_PULLUP);
pinMode(btnPin2, INPUT_PULLUP);
MIDI.begin();
}
void loop() {
lastBtnState = btnState;
btnState = digitalRead(btnPin1);
if(lastBtnState == 1 && btnState == 0){
MIDI.sendNoteOn(60, 127, 1);
delay(50);
}
else if(lastBtnState == 0 && btnState == 1){
MIDI.sendNoteOff(60, 0, 1);
delay(150);
}
lastBtnState = btnState;
btnState = digitalRead(btnPin2);
if(lastBtnState == 1 && btnState == 0){
MIDI.sendNoteOn(70, 127, 1);
delay(50);
}
else if(lastBtnState == 0 && btnState == 1){
MIDI.sendNoteOff(70, 0, 1);
delay(150);
}
}`
Thank you so much in advance for anyone taking the time to look at this and help me :)
Beta Was this translation helpful? Give feedback.
All reactions