hey is anyone reading anything i post???
i have a strange problem with my teensy!!
at the moment im working on getting a matrix of 8*16 to work and this code i have just got working
but when i upload this code
Code:
const byte sensor0 = 20;
const byte sensor1 = 21;
const byte reciverA = 14;
const byte reciverB = 15;
const byte reciverC = 16;
const byte transmitA = 17;
const byte transmitB = 18;
const byte transmitC = 19;
int v=0;
int w=0;
void setup() {
Serial.begin(115200);
pinMode(reciverA,OUTPUT);
pinMode(reciverB,OUTPUT);
pinMode(reciverC,OUTPUT);
pinMode(transmitA,OUTPUT);
pinMode(transmitB,OUTPUT);
pinMode(transmitC,OUTPUT);
pinMode(sensor0,INPUT);
pinMode(sensor1,INPUT);
}
int readKeyboard() {
int j,i,row,col,v, x, code;
code=0;
for(i=0;i<=7;i++) {
for(j=0;j<=7;j++) {
code++;
// address X
{
digitalWrite (transmitA, (i & 1) ? HIGH : LOW);
digitalWrite (transmitB, (i & 2) ? HIGH : LOW);
digitalWrite (transmitC, (i & 4) ? HIGH : LOW);
}
// address Y
{
digitalWrite (reciverA, (j & 1) ? HIGH : LOW);
digitalWrite (reciverB, (j & 2) ? HIGH : LOW);
digitalWrite (reciverC, (j & 4) ? HIGH : LOW);
analogRead(sensor0);
analogRead(sensor1);
}
//delay(100);
// Read the actual Value
v = analogRead(sensor0);
w = analogRead(sensor1);
/*
Serial.print("Row: ");
Serial.print(j);
Serial.print(",Col: ");
Serial.print(i);
Serial.print("),IC1: ");
Serial.print(v);
Serial.print(" ,IC2: ");
Serial.println(w);
*/
if(v==1023)
{
return code;
}
if(w==1023)
{
return (code+64);
}
}
}
}
void loop() {
v = readKeyboard();
if(v>0);
{
Serial.println(v);
}
delay(100);
}
and start the serial monitor
some times it shows a string of 0's when no button is pushed witch is right but if i upload the code again it some times it does a string of 1's when no button is pushed witch is not right and i dont no what is coursing it 
i have attached a pdf of how i have it wired up but i forgot to put on it all the unused pins on the 4051's are connected to ground!
HTML Code:
https://www.dropbox.com/s/3jfw4iboehgbnck/matrix1.pdf?dl=0