right on. thanks for your help thus far. to anyone else on the radar heres the code i have running now:
/*
* codeexample for useing a 4051 * analog multiplexer / demultiplexer
* by david c. and tomek n.* for k3 / malmö högskola
*
*/
int led = 13; //just a led
int r0 = 0; //value select pin at the 4051 (s0)
int r1 = 0; //value select pin at the 4051 (s1)
int r2 = 0; //value select pin at the 4051 (s2)
int row = 0; // storeing the bin code
int count = 0; // just a count
int analogPin = 0;
int val = 0; // variable to store the read value
int threshold = 512; // threshold
int bin [] = {000, 1, 10, 11, 100, 101, 110, 111};//bin = binär, some times it is so easy
void setup(){
Serial.begin(9600);
pinMode(2, OUTPUT); // s0
pinMode(3, OUTPUT); // s1
pinMode(4, OUTPUT); // s2
}
void loop () {
for (count=0; count<=7; count++) {
row = bin[count];
r0 = row & 0x01;
r1 = (row>>1) & 0x01;
r2 = (row>>2) & 0x01;
digitalWrite(2, r0);
digitalWrite(3, r1);
digitalWrite(4, r2);
//Serial.println(bin[count]);
delay (100);
val = analogRead(analogPin); // read the input pin
if (val >= threshold) {
Serial.print(val, DEC);
} else {
Serial.print("off ");
}
}
}
currently it checks the pot to see if its been moved about half way and then it prints the value. otherwise it prints "off" what i need to figure out how to do is get ti to cycle through all the different ports and read out the values individually. im also beginning to think that maybe having the arduino spit out midi itself is a better way to go than have max read the pots and then translate it to midi. this might even be a faster application?
any thoughts on this are welcome in the mean time ill trudge forward.