Loading...
Pages: [1]   Go Down
Author Topic: Problem with teensy  (Read 279 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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..)
Logged

Valencia, Spain
Offline Offline
Edison Member
*
Karma: 65
Posts: 2282
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

try this:

Code:
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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Brisbane, Australia
Offline Offline
God Member
*****
Karma: 17
Posts: 812
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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
Logged

Offline Offline
Sr. Member
****
Karma: 11
Posts: 393
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

http://forum.pjrc.com
Logged

Pages: [1]   Go Up
Print
 
Jump to: