Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 3 of 3

Thread: Teensy 3.0 'Keyboard' was not declared in this scope

  1. #1
    Junior Member
    Join Date
    Nov 2012

    Teensy 3.0 'Keyboard' was not declared in this scope

    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 -
    - 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
    Last edited by borkweb; 11-11-2012 at 01:50 PM.

  2. #2
    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?

  3. #3
    Junior Member
    Join Date
    Nov 2012
    Well, that would explain things

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts