Pages: [1]   Go Down
Author Topic: Problem with teensy  (Read 445 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
Faraday Member
**
Karma: 118
Posts: 4549
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

No, I don't answer questions sent in private messages...

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
Edison Member
*
Karma: 29
Posts: 1071
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

"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

Offline Offline
God Member
*****
Karma: 21
Posts: 650
View Profile
WWW
 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

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

Pages: [1]   Go Up
Jump to: