Teensy 3.0 'Keyboard' was not declared in this scope

Status
Not open for further replies.

borkweb

New member
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:

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

Code:
/* 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() {
  Serial.begin(9600);
  delay(1000);
}

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

  // You can also send to the Arduino Serial Monitor
  Serial.println(count);

  // increment the count
  count = count + 1;

  // typing too rapidly can overwhelm a PC
  delay(5000);
}
 
Last edited:
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?
 
Status
Not open for further replies.
Back
Top