Gripporillat
Well-known member
Hi everybody. I'm constructing a Midicontroller. It has three basic elements, potis, flash buttons and normal buttons. I wrote my own library and with a lot of help from this forum it works pretty well now. Thanks to responsiveanalogread library my potis work very smothly and stably. Since there will be a lot of inputs I'm now doing some testing with multiplexing. My first try was with 7 potis and 7 flash buttons and I got that many confusing values that I had to restart. My very simple circuit looks like this now:
This is the code:
The result is not as catastrophic as with the 14 inputs I tried before, the fader works very smoothly. But I don't get any MIDI values above 110, which is very confusing to me. It's definitely not a conversion error. It seems that about 13% of the upper side of the poti deliver the same value.
What am I doing wrong?
This is the code:
Code:
#include "SkyController.h"
SkyPoti poti(A0, 1, 1);
int mpxpin1=0;
int mpxpin2=1;
int mpxpin3=2;
void setup() {
pinMode(mpxpin1, OUTPUT);
pinMode(mpxpin2, OUTPUT);
pinMode(mpxpin3, OUTPUT);
}
void loop() {
digitalWrite(mpxpin1, LOW);
digitalWrite(mpxpin2, LOW);
digitalWrite(mpxpin3, LOW);
delayMicroseconds(200);
poti.send();
digitalWrite(mpxpin1, HIGH);
digitalWrite(mpxpin2, HIGH);
digitalWrite(mpxpin3, HIGH);
delayMicroseconds(200);
}
The result is not as catastrophic as with the 14 inputs I tried before, the fader works very smoothly. But I don't get any MIDI values above 110, which is very confusing to me. It's definitely not a conversion error. It seems that about 13% of the upper side of the poti deliver the same value.
What am I doing wrong?