Is there a driver for a Pro-Micro Arduino for Win XP?How to Build DIY Arduino USB Expression Pedal for Efektor WF3607 | Kuassa
I'm trying to run one as a MIDI controller using this code taken from here
https://www.kuassa.com/diy-tutorial-how-to-build-arduino-based-expression-pedal-for-efektor-wf3607/:
#include "MIDIUSB.h"
// Expression pedal pin
#define expPin A0
// Switch 3PDT pin
#define switchPin 9
int sensorValue = 0;
int lastVal = 0;
int tempAnalog = 0;
int switchVal = HIGH;
void setup() {
Serial.begin(300);
pinMode(switchPin, INPUT);
}
void controlChange(byte channel, byte control, byte value) {
midiEventPacket_t event = {0x0B, 0xB0 | channel, control, value};
MidiUSB.sendMIDI(event);
}
void loop() {
// Reinit Analog Value
sensorValue = 0;
// Read analog value
tempAnalog = analogRead(expPin);
// Convert 10 bit to 7 bit
tempAnalog = map(tempAnalog, 0, 1023, 0, 127);
tempAnalog = constrain(tempAnalog, 0, 127);
// Read digital input (Switch)
int readSwitch = digitalRead(switchPin);
// Send switch status
if(switchVal != readSwitch){
switchVal = readSwitch;
// Off (0 - 63), On (64 - 127)
// CC 80 (Our default value for switch 3PDT is using
// MIDI control change number 80
// Change this to change control the change number)
if(switchVal == HIGH){
controlChange(1, 80, 127);
}
else{
controlChange(1, 80, 0);
}
MidiUSB.flush();
}
// Send pedal status
if(tempAnalog != lastVal)
{
// CC 11 (Our default value for expression pedal is using
// MIDI control change number 11
// Change this to change control the change number)
controlChange(1, 11, tempAnalog);
// !Important, Flush after send
MidiUSB.flush();
}
// Store current value to be used laters
lastVal = tempAnalog;
delay(5);
}
I also have the ability to use it in Linux (I believe it works without a driver) and for some reason it does nothing. I have pin 9 hard wired HIGH and am changing the value of Analog Pin 0.