Duhjoker
Well-known member
They have adapters for teensy 3.2 and i think they once produced a teensy feather. But don't quote me. Its a neat set up though. I made a wooden case for mine.
ok so heres the deal I made this set up which works and only outputs when a button or direction is placed.
but when I separate them out to different functions like so it goes haywire constantly throwing up left right up or down in the serial monitor.
WTH??!!!!
ok so heres the deal I made this set up which works and only outputs when a button or direction is placed.
Code:
int x = ss1.analogRead(2);
int y = ss1.analogRead(3);
if ( (abs(x - last_x) > 3) || (abs(x + last_x) < 3) || (abs(y - last_y) > 3) || (abs(y + last_y) < 3)) {
Serial.print(x); Serial.print(", "); Serial.println(y);
last_x = x;
last_y = y;
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
int x1 = ss2.analogRead(2);
int y1 = ss2.analogRead(3);
if ( (abs(x1 - last_x2) > 3) || (abs(x1 + last_x2) < 3) || (abs(y1 - last_y2) > 3) || (abs(y1 + last_y2) < 3)) {
Serial.print(x); Serial.print(", "); Serial.println(y);
last_x2 = x1;
last_y2 = y1;
}
but when I separate them out to different functions like so it goes haywire constantly throwing up left right up or down in the serial monitor.
Code:
int x = ss1.analogRead(2);
int y = ss1.analogRead(3);
if ( (abs(x - last_x) > 3)){
Serial.print("left1");
last_x = x;
}
if ( (abs(x + last_x) < 3)){
Serial.print("right1");
last_x = x;
}
if ( (abs(y - last_y) < 3)){
Serial.print("down1");
last_y = y;
}
if ( (abs(y + last_y) > 3)){
Serial.print("up1");
last_y = y;
}
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
/* int x2 = ss2.analogRead(2);
int y2 = ss2.analogRead(3);
if ( (abs(x2 - last_x2) > 3)){
Serial.print("left2");
last_x2 = x2;
}
if ( (abs(x2 + last_x2) < 3)){
Serial.print("right2");
last_x2 = x2;
}
if ( (abs(y2 - last_y2) < 3)){
Serial.print("down2");
last_y2 = y2;
}
if ( (abs(y + last_y) > 3)){
Serial.print("up2");
last_y2 = y2;
}*/
WTH??!!!!