Teensy ++ 2.0 prints randomly, with interruption.Р

Status
Not open for further replies.

saperrus

New member
Hello! I bought teensy ++ 2.0. I have a problem.
Using the Keyboard code:

Code:
int count = 0;
void setup() { } // no setup needed
void loop() {
  Keyboard.print("Hello World "); 
  Keyboard.println(count);
  count = count + 1;
  delay(5000);
}

The sketch loaded normally, but the teensy begins to write randomly quickly. Not what is written in the sketch. This is the interruption of words and the typing of one letter many times in a row. In the end, this does not work properly. Does this problem have a solution? Thank you!

VIDEO:

FOTO:
1.jpg
 
There is certainly not much matching between the video and the code. Does it ever actually print numbers? The number print should line feed so looks like that line never executes.

Can you post a photo of the board, or have a look at https://www.pjrc.com/store/teensypp.html and see if it is actually a Teensy product since counterfiets do all sorts of strange things.

Does serial print to terminal work from one of the examples like?

Code:
void setup()   {                
  Serial.begin(38400);
}

void loop()                     
{
  Serial.println("Hello World");
  delay(1000);
}
Both use USB and this is looking like something amiss in the USB path from the Teensy through to the window where the text was typed.
 
No, it's not numbers. This: "hello world" I think that the error is not in the code. but in the motherboard itself. Because I tried different versions of the keyboard library.
 
Because I tried different versions of the keyboard library.

On Teensy, you do this by clicking the Tools > USB Type menu.

This is different from Arduino, where various libraries need to be included. Don't do that on Teensy. On Teensy you don't need any library for your Teensy to work as a USB Keyboard. Instead you use the Tools > USB Type menu.

If you're reading various tutorial written for Arduino, know that this detail is different on Teensy. No additional library is supposed to be used with Teensy.
 
Works for me. I built your sketch on IDE 1.8.4 on Teensy ++ 2 selecting Tools>USB type: keyboard + ....
characters appear in IDE edit window or whatever active terminal window i select (Ubuntu). Also plugged the Teensy into Mac OS, worked, and into Windows 10 with Notedpad -- worked.

Ref: https://www.pjrc.com/teensy/td_keyboard.html

As GremlinWrangler noted, maybe you have a counterfeit Teensy. Have you tried connecting to other PC's (Ubuntu, Mac ....) ?
 
Status
Not open for further replies.
Back
Top