The expression pedal board contains two analog circuits for the two pedals, a simple switch and a LED. The connector has one pin for each, plus a ground and Vcc pin.
The pedals use an infrared LED and photo-transistor that is slightly amplified by a transistor. They produce a weak analog value. I have not been able to get reliable readings on the pins. I suspect that the unit has to be embedded into its casing to prevent stray light from reaching the receptor.UPDATE: By measuring voltage at a different point on the pedal circuits, I was able to get full readings, from 0 to approximately 5 volts. I Guess that transistor is not used as an amplifier but as a switching transistor. I will replace the connections on the socket. I will just bypass the transistors.
The LED on the left (led9) will be addressed directly with a digital pin from the Arduino. The switch is activated by pressing firmly on the pedal, to engage the WAH function on the effects board. It will be read directly with a digital or analog pin.
/* */ int led9=9; int express=1; int wah=2; void setup() { Serial.begin(9600); pinMode(led9, OUTPUT); } void loop() { //Read analog signals from both pedals int pedValue1 = analogRead(express); int pedValue2 = analogRead(wah); Serial.print(pedValue1); Serial.print(" "); Serial.println(pedValue2); //read sw9 from the pedal sub-board int switch9 = analogRead(A3); if (switch9 != 0) digitalWrite(led9,LOW); else digitalWrite(led9,HIGH); }
Leave a Reply