View Full Version : Teensy 3.0 'Keyboard' was not declared in this scope

11-11-2012, 02:24 PM
Howdy! I'm wondering if anyone has any advice on some trouble I'm having with my Teensy 3.0 in Arduino. When attempting to compile the Example Teensy > USB_Keyboard > Simple code, I'm getting the error:

Simple.pde: In function 'void loop()':
Simple:18: error: 'Keyboard' was not declared in this scope

Things I have done before attempting to Verify/Compile:

- Installed Teensy
- Installed Teensyduino
- Installed the Arduino 1.0.2 Teensy 3 Beta 7 - http://www.pjrc.com/teensy/beta/arduino-1.0.2-teensy3-beta7-macos.zip
- In Arduino with the code showing, I went to Tools > Board and selected Teensy 3.0
- Then I selected: Tools > USB Type: Keyboard + Mouse + Joystick

Hitting "Verify" results in the above error. As I'm new to both Teensy and Arduino, I'm unsure what my next step should be. I've searched for the answer to this issue for quite a while and have come up empty. Thoughts?

For clarity, here's the example code in question:

/* Simple USB Keyboard Example
Teensy becomes a USB keyboard and types characters

You must select Keyboard from the "Tools > USB Type" menu

This example code is in the public domain.

int count = 0;

void setup() {

void loop() {
// Your computer will receive these characters from a USB keyboard.
Keyboard.print("Hello World ");

// You can also send to the Arduino Serial Monitor

// increment the count
count = count + 1;

// typing too rapidly can overwhelm a PC

11-11-2012, 02:51 PM
I'm pretty sure that the Keyboard USB mode is not yet implemented and therefore the functions won't work. Only Serial is working in the latest beta--Paul, is that correct?

11-11-2012, 02:52 PM
Well, that would explain things :)