Go Down

Topic: Problem with teensy (Read 595 times) previous topic - next topic

nofame

Hi, I'm currently working on a teensy based (game)controller, but i have some problems:
My projects just keeps spitting out random letters forever, whenever i push a button (the point is it should spit out one specific letter at a time).
I have tested my circut pretty well, and can't seem to find my flaw in there, but would you maybe take a look at me (relatively short) to see if the mistake is in there? http://pastebin.com/wjvQB2HT

or could multiple wires close together interfere with each other (sorry, i'm not a smart man..)

fungus

try this:

Code: [Select]

void setup() {

  for(int i = 0; i < 4; i++)
  {
    pinMode(pins[i], INPUT);
   digitalWrite(pins[i], HIGH);
  }
}


The digialWrite enables a pull up resistor on the input. Without it the pin will be floating around picking up the local radio station or the neighbor's microwave oven.
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

nofame


The digialWrite enables a pull up resistor on the input. Without it the pin will be floating around picking up the local radio station or the neighbor's microwave oven.

I'm already using a pull-down resistor, so there shouldn't be any problem there.

strykeroz

When you say random letters, I take that to mean you're getting lots of output outside of the 4 values in the array which gave me an idea.  Does having
Code: [Select]
Keyboard.begin();in setup() make a difference?  I don't have a Teensy nor Leonardo to test this with, so I created a small sketch that calls Serial.print without a Serial.begin call and found it compiled but didn't produce output either.

Stabbing blindly in the dark and hoping for the best,
Geoff
"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

pico

In case you are not aware, the teensy boards have their own support forum at

http://forum.pjrc.com
WiFi shields/Yun too expensive? Embeddedcoolness.com is now selling the RFXduino nRF24L01+ <-> TCP/IP Linux gateway: Simpler, more affordable, and even more powerful wireless Internet connectivity for *all* your Arduino projects! (nRF24L01+ shield and dev board kits available too.)

Go Up