Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties and Verbose
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 8 Replies) error: 'Keyboard' was not declared in this scope (Read 20120 times)
wolf
Junior Member
**
Offline


Posts: 33
Joined: Sep 19th, 2014
error: 'Keyboard' was not declared in this scope
Oct 5th, 2014 at 8:09am
Print Post  
This sketch runs fine in Aruino 1.0.6 Ide.
But when I compile the same sketch in AtmelStudio Visual Micro it gets "error: 'Keyboard' was not declared in this scope":
Code (C++)
Select All
void setup()
{
	Keyboard.begin();
	delay(2000);
}

void loop()
{
	delay(1000);
	//Keyboard.press(KEY_Y);
	//Keyboard.release(KEY_Y);
} 


Verbose messages: Quote:
Compiling 'kb' for 'Teensy 2.0'
Build folder: file:///C:/Users/wolf/AppData/Local/VMicro/Arduino/Builds/kb/teensy2
Summary: Header=1 Prototypes=3 Imports=0
Additional Defines: Defines Project: F_CPU=16000000L;USB_SERIAL;LAYOUT_US_ENGLISH;VISUALMICRO_COMPILER_VER=1;
Architecture Tools: C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\
GCC: 4.3.2
Sketchbook: file:///C:/Users/wolf/Documents/Arduino
Core Include Paths
Include Path 'C:\Program Files (x86)\Arduino\hardware\teensy\cores\teensy'
C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-g++ -c -g -Os -fno-exceptions -ffunction-sections -fdata-sections -Wall -mmcu=atmega32u4 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=106 -felide-constructors -I"C:\Program Files (x86)\Arduino\hardware\teensy\cores\teensy" -o "C:\Users\wolf\AppData\Local\VMicro\Arduino\Builds\kb\teensy2\kb.cpp.o"  "C:\Users\wolf\AppData\Local\VMicro\Arduino\Builds\kb\teensy2\kb.cpp"  -DDefines=Project:=F_CPU=16000000L -DUSB_SERIAL -DLAYOUT_US_ENGLISH -DVISUALMICRO_COMPILER_VER=1  -DTEENSYDUINO=120 
wiring.h:In file included from
WProgram.h:from
arduino.h:from
kb.ino:from
core_pins.h:1915:4: error: #error "Clock must be 16, 8, 4, 2 or 1 MHz"
wiring.h:In file included from
WProgram.h:from
arduino.h:from
kb.ino:from
core_pins.h:In function 'void delayMicroseconds(uint16_t)'
core_pins.h:1917: error: 'tmp' was not declared in this scope
core_pins.h:1934: error: invalid lvalue in asm output 0
WProgram.h:In file included from
arduino.h:from
kb.ino:from
HardwareSerial.h:In member function 'void HardwareSerial::begin(uint32_t, uint8_t)'
HardwareSerial.h:11: error: 'F_CPU' was not declared in this scope
kb.ino:In function 'void setup()'
kb.ino:10: error: 'Keyboard' was not declared in this scope
Error compiling


I am running Teensyduino 1.20 Release Candidate #5 on Aruduino 1.0.6, AtmelStudio 6.2, Visual Micro
Where do I start trouble shooting?

Thank you.
« Last Edit: Oct 5th, 2014 at 9:08am by wolf »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 11676
Location: United Kingdom
Joined: Apr 10th, 2010
Re: error: 'Keyboard' was not declared in this scope
Reply #1 - Oct 5th, 2014 at 1:27pm
Print Post  
I see you are using a teensy version of the Arduino Ide and as you know you will have selected the speed, keyboard, usb etc from the menus.

In Visual Micro you have entered these settings as defines but it looks like you got the defines wrong. 

In fact F_CPU is also report as missing and the speed unknown. All of the errors relate to the defines being invalid.

I think when you pasted in the defines you did not realize that you had other text selected.

You do NOT need the text Defines=Project: which you have added by mistake

You must simply add project level defines as follows:-

Code
Select All
F_CPU=16000000L;USB_SERIAL;LAYOUT_US_ENGLISH 



NOT

Code
Select All
Defines Project:
F_CPU=16000000L;USB_SERIAL;LAYOUT_US_ENGLISH 

« Last Edit: Oct 5th, 2014 at 2:36pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
wolf
Junior Member
**
Offline


Posts: 33
Joined: Sep 19th, 2014
Re: error: 'Keyboard' was not declared in this scope
Reply #2 - Oct 5th, 2014 at 3:48pm
Print Post  
Thanks for catching that.
So I edited the "Defines - Project" field to correct it, and restarted Atmel Studio, but the same error persists:
Quote:
Compiling 'kb' for 'Teensy 2.0'
Build folder: file:///C:/Users/wolf/AppData/Local/VMicro/Arduino/Builds/kb/teensy2
Summary: Header=1 Prototypes=3 Imports=2
Additional Defines: F_CPU=16000000L;USB_SERIAL;LAYOUT_US_ENGLISH;VISUALMICRO_COMPILER_VER=1;
Architecture Tools: C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\
GCC: 4.3.2
Sketchbook: file:///C:/Users/wolf/Documents/Arduino
Core Include Paths
Include Path 'C:\Program Files (x86)\Arduino\hardware\teensy\cores\teensy'
Library Include Paths (1)
Include Path 'C:\Program Files (x86)\Arduino\libraries\Wire'
Platform Libraries Root Include Paths
Include Path 'C:\Program Files (x86)\Arduino\libraries'
Include Path 'C:\Program Files (x86)\Arduino\hardware\teensy\libraries'
Include Path 'C:\Program Files (x86)\Visual Micro\Visual Micro for Arduino\Micro Platforms\default\debuggers'
Include Path 'C:\Users\wolf\Documents\Arduino\libraries'
C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-g++ -c -g -Os -fno-exceptions -ffunction-sections -fdata-sections -Wall -mmcu=atmega32u4 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=106 -felide-constructors -I"C:\Program Files (x86)\Arduino\hardware\teensy\cores\teensy" -I"C:\Program Files (x86)\Arduino\libraries\Wire" -I"C:\Program Files (x86)\Arduino\libraries" -I"C:\Program Files (x86)\Arduino\hardware\teensy\libraries" -I"C:\Program Files (x86)\Visual Micro\Visual Micro for Arduino\Micro Platforms\default\debuggers" -I"C:\Users\wolf\Documents\Arduino\libraries" -o "C:\Users\wolf\AppData\Local\VMicro\Arduino\Builds\kb\teensy2\kb.cpp.o"  "C:\Users\wolf\AppData\Local\VMicro\Arduino\Builds\kb\teensy2\kb.cpp"  -DF_CPU=16000000L -DUSB_SERIAL -DLAYOUT_US_ENGLISH -DVISUALMICRO_COMPILER_VER=1  -DTEENSYDUINO=120 
kb.ino:4:22: warning: Keyboard.h: No such file or directory
kb.ino:In function 'void setup()'
kb.ino:12: error: 'Keyboard' was not declared in this scope
Error compiling
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 11676
Location: United Kingdom
Joined: Apr 10th, 2010
Re: error: 'Keyboard' was not declared in this scope
Reply #3 - Oct 5th, 2014 at 4:02pm
Print Post  
Hi,

try clicking "build>clean solution" and then run the build. This will ensure the previous failed build with missing defines is cleared and the compiler cache can start fresh.

Please also post your full sketch code. the error suggests that keyboard.h has been included in the sketch but it can't be resolved so I would like to see the syntax

thanks
  
Back to top
WWW  
IP Logged
 
wolf
Junior Member
**
Offline


Posts: 33
Joined: Sep 19th, 2014
Re: error: 'Keyboard' was not declared in this scope
Reply #4 - Oct 5th, 2014 at 4:48pm
Print Post  
I clicked "build>clean solution", thanks for reminding me.
But the error is still there:
Quote:
Sketchbook: file:///C:/Users/wolf/Documents/Arduino
All import libraries will be re-compiled
Core Include Paths
Include Path 'C:\Program Files (x86)\Arduino\hardware\teensy\cores\teensy'
Library Include Paths (1)
Include Path 'C:\Program Files (x86)\Arduino\libraries\Wire'
Platform Libraries Root Include Paths
Include Path 'C:\Program Files (x86)\Arduino\libraries'
Include Path 'C:\Program Files (x86)\Arduino\hardware\teensy\libraries'
Include Path 'C:\Program Files (x86)\Visual Micro\Visual Micro for Arduino\Micro Platforms\default\debuggers'
Include Path 'C:\Users\wolf\Documents\Arduino\libraries'
C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-g++ -c -g -Os -fno-exceptions -ffunction-sections -fdata-sections -Wall -mmcu=atmega32u4 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=106 -felide-constructors -I"C:\Program Files (x86)\Arduino\hardware\teensy\cores\teensy" -I"C:\Program Files (x86)\Arduino\libraries\Wire" -I"C:\Program Files (x86)\Arduino\libraries" -I"C:\Program Files (x86)\Arduino\hardware\teensy\libraries" -I"C:\Program Files (x86)\Visual Micro\Visual Micro for Arduino\Micro Platforms\default\debuggers" -I"C:\Users\wolf\Documents\Arduino\libraries" -o "C:\Users\wolf\AppData\Local\VMicro\Arduino\Builds\kb\teensy2\kb.cpp.o"  "C:\Users\wolf\AppData\Local\VMicro\Arduino\Builds\kb\teensy2\kb.cpp"  -DF_CPU=16000000L -DUSB_SERIAL -DLAYOUT_US_ENGLISH -DVISUALMICRO_COMPILER_VER=1  -DTEENSYDUINO=120 
kb.ino:4:22: warning: Keyboard.h: No such file or directory
kb.ino:In function 'void setup()'
kb.ino:12: error: 'Keyboard' was not declared in this scope
C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-g++ -c -g -Os -fno-exceptions -ffunction-sections -fdata-sections -Wall -mmcu=atmega32u4 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=106 -felide-constructors -I"C:\Program Files (x86)\Arduino\hardware\teensy\cores\teensy" -I"C:\Program Files (x86)\Arduino\libraries\Wire" -I"C:\Program Files (x86)\Arduino\libraries" -I"C:\Program Files (x86)\Arduino\hardware\teensy\libraries" -I"C:\Program Files (x86)\Visual Micro\Visual Micro for Arduino\Micro Platforms\default\debuggers" -I"C:\Users\wolf\Documents\Arduino\libraries" -I"C:\Program Files (x86)\Arduino\libraries\Wire\utility" -o  "C:\Program Files (x86)\Arduino\libraries\Wire\Wire.cpp"  -DF_CPU=16000000L -DUSB_SERIAL -DLAYOUT_US_ENGLISH -DVISUALMICRO_COMPILER_VER=1  -DTEENSYDUINO=120 
C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=atmega32u4 -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=106 -I"C:\Program Files (x86)\Arduino\hardware\teensy\cores\teensy" -I"C:\Program Files (x86)\Arduino\libraries\Wire" -I"C:\Program Files (x86)\Arduino\libraries" -I"C:\Program Files (x86)\Arduino\hardware\teensy\libraries" -I"C:\Program Files (x86)\Visual Micro\Visual Micro for Arduino\Micro Platforms\default\debuggers" -I"C:\Users\wolf\Documents\Arduino\libraries" -I"C:\Program Files (x86)\Arduino\libraries\Wire\utility" "C:\Program Files (x86)\Arduino\libraries\Wire\utility\twi.c" -o .o"  -DTEENSYDUINO=120  -DF_CPU=16000000L -DUSB_SERIAL -DLAYOUT_US_ENGLISH -DVISUALMICRO_COMPILER_VER=1
Error compiling

This is the sketch:
Code (C++)
Select All
#include <Wire.h>
#include <Keyboard.h>

void setup()
{
	Keyboard.begin();
    Wire.begin();
	delay(2000);
}

void loop()
{
	delay(1000);
	//Keyboard.press(KEY_Y);
	//Keyboard.release(KEY_Y);
} 

  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 11676
Location: United Kingdom
Joined: Apr 10th, 2010
Re: error: 'Keyboard' was not declared in this scope
Reply #5 - Oct 5th, 2014 at 5:10pm
Print Post  
Okay great. I think you just need the correct define to tell Teensy you want to use the keyboard (HID) function

use

USB_SERIAL_HID

instead of

USB_SERIAL

I will alter the example so that people get the keyboard by default.

  
Back to top
WWW  
IP Logged
 
wolf
Junior Member
**
Offline


Posts: 33
Joined: Sep 19th, 2014
Re: error: 'Keyboard' was not declared in this scope
Reply #6 - Oct 5th, 2014 at 5:22pm
Print Post  
That fixed it!
Quote:
Properties Window, scroll to Micro General (Project Global) > Defines - Project:
F_CPU=16000000L;USB_SERIAL_HID;LAYOUT_US_ENGLISH

Thank you so much.
  
Back to top
 
IP Logged
 
wolf
Junior Member
**
Offline


Posts: 33
Joined: Sep 19th, 2014
Re: error: 'Keyboard' was not declared in this scope
Reply #7 - Oct 11th, 2014 at 7:33pm
Print Post  
This was working a few days ago, now this error is back:
Quote:
"error: 'Keyboard' was not declared in this scope"

I have checked the following, and they are the same from when the code was compiling:
  • Micro General (Project Global) Defines - Project: F_CPU=16000000L;USB_SERIAL_HID;LAYOUT_US_ENGLISH
  • #include <Keyboard.h> is in the header file and ino file

I also: Build > Clean Solution

The code compiles on Arduino IDE.

What else can I trouble shoot?

Thank you.

Quote:
Compiling 'breadboard_122' for 'Arduino Uno'
Build folder: file:///C:/Users/wolf/AppData/Local/VMicro/Arduino/Builds/breadboard_122/uno
Summary: Header=1 Prototypes=3 Imports=19
Additional Defines: F_CPU=16000000L;USB_SERIAL_HID;LAYOUT_US_ENGLISH;VISUALMICRO_COMPILER_VER=1;
Architecture Tools: C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\
GCC: 4.3.2
Sketchbook: file:///C:/Users/wolf/Documents/Arduino
All import libraries will be re-compiled
Core Include Paths
Include Path 'C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino'
Include Path 'C:\Program Files (x86)\Arduino\hardware\arduino\variants\standard'
Library Include Paths (6)
Include Path 'C:\Program Files (x86)\Arduino\libraries\Wire'
Include Path 'C:\Users\wolf\Documents\Arduino\libraries\KB_ScanCode'
Include Path 'C:\Users\wolf\Documents\Arduino\libraries\KB_Key'
Include Path 'C:\Users\wolf\Documents\Arduino\libraries\KB_Row'
Include Path 'C:\Users\wolf\Documents\Arduino\libraries\KB_Matrix'
Include Path 'C:\Users\wolf\Documents\Arduino\libraries\KB_Keybrd'
Platform Libraries Root Include Paths
Include Path 'C:\Program Files (x86)\Arduino\libraries'
Include Path 'C:\Program Files (x86)\Arduino\hardware\arduino\libraries'
Include Path 'C:\Program Files (x86)\Visual Micro\Visual Micro for Arduino\Micro Platforms\default\debuggers'
Include Path 'C:\Users\wolf\Documents\Arduino\libraries'
C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-g++ -c -g -Os -fno-exceptions -ffunction-sections -fdata-sections -Wall -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=106 -I"C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino" -I"C:\Program Files (x86)\Arduino\hardware\arduino\variants\standard" -I"C:\Program Files (x86)\Arduino\libraries\Wire" -I"C:\Users\wolf\Documents\Arduino\libraries\KB_ScanCode" -I"C:\Users\wolf\Documents\Arduino\libraries\KB_Key" -I"C:\Users\wolf\Documents\Arduino\libraries\KB_Row" -I"C:\Users\wolf\Documents\Arduino\libraries\KB_Matrix" -I"C:\Users\wolf\Documents\Arduino\libraries\KB_Keybrd" -I"C:\Program Files (x86)\Arduino\libraries" -I"C:\Program Files (x86)\Arduino\hardware\arduino\libraries" -I"C:\Program Files (x86)\Visual Micro\Visual Micro for Arduino\Micro Platforms\default\debuggers" -I"C:\Users\wolf\Documents\Arduino\libraries" -o _122.cpp.o"  _122.cpp"  -DF_CPU=16000000L -DUSB_SERIAL_HID -DLAYOUT_US_ENGLISH -DVISUALMICRO_COMPILER_VER=1
breadboard_122.ino:In file included from
SU.h:5:22: warning: Keyboard.h: No such file or directory
breadboard_122.ino:In file included from
SM.h:5:19: warning: Mouse.h: No such file or directory
breadboard_122.ino:In file included from
LayerManager.h:5:30: warning: cstdlib: No such file or directory
LayerManager.h:In file included from
breadboard_122.ino:from
KL.h:3:30: warning: cstddef: No such file or directory
C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-g++ -c -g -Os -fno-exceptions -ffunction-sections -fdata-sections -Wall -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=106 -I"C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino" -I"C:\Program Files (x86)\Arduino\hardware\arduino\variants\standard" -I"C:\Program Files (x86)\Arduino\libraries\Wire" -I"C:\Users\wolf\Documents\Arduino\libraries\KB_ScanCode" -I"C:\Users\wolf\Documents\Arduino\libraries\KB_Key" -I"C:\Users\wolf\Documents\Arduino\libraries\KB_Row" -I"C:\Users\wolf\Documents\Arduino\libraries\KB_Matrix" -I"C:\Users\wolf\Documents\Arduino\libraries\KB_Keybrd" -I"C:\Program Files (x86)\Arduino\libraries" -I"C:\Program Files (x86)\Arduino\hardware\arduino\libraries" -I"C:\Program Files (x86)\Visual Micro\Visual Micro for Arduino\Micro Platforms\default\debuggers" -I"C:\Users\wolf\Documents\Arduino\libraries" -I"C:\Program Files (x86)\Arduino\libraries\Wire\utility" -o cpp.o"  "C:\Program Files (x86)\Arduino\libraries\Wire\Wire.cpp"  -DF_CPU=16000000L -DUSB_SERIAL_HID -DLAYOUT_US_ENGLISH -DVISUALMICRO_COMPILER_VER=1
C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=106 -I"C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino" -I"C:\Program Files (x86)\Arduino\hardware\arduino\variants\standard" -I"C:\Program Files (x86)\Arduino\libraries\Wire" -I"C:\Users\wolf\Documents\Arduino\libraries\KB_ScanCode" -I"C:\Users\wolf\Documents\Arduino\libraries\KB_Key" -I"C:\Users\wolf\Documents\Arduino\libraries\KB_Row" -I"C:\Users\wolf\Documents\Arduino\libraries\KB_Matrix" -I"C:\Users\wolf\Documents\Arduino\libraries\KB_Keybrd" -I"C:\Program Files (x86)\Arduino\libraries" -I"C:\Program Files (x86)\Arduino\hardware\arduino\libraries" -I"C:\Program Files (x86)\Visual Micro\Visual Micro for Arduino\Micro Platforms\default\debuggers" -I"C:\Users\wolf\Documents\Arduino\libraries" -I"C:\Program Files (x86)\Arduino\libraries\Wire\utility" "C:\Program Files (x86)\Arduino\libraries\Wire\utility\twi.c" -o ty\twi.c.o" -DF_CPU=16000000L -DUSB_SERIAL_HID -DLAYOUT_US_ENGLISH -DVISUALMICRO_COMPILER_VER=1
C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-g++ -c -g -Os -fno-exceptions -ffunction-sections -fdata-sections -Wall -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=106 -I"C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino" -I"C:\Program Files (x86)\Arduino\hardware\arduino\variants\standard" -I"C:\Program Files (x86)\Arduino\libraries\Wire" -I"C:\Users\wolf\Documents\Arduino\libraries\KB_ScanCode" -I"C:\Users\wolf\Documents\Arduino\libraries\KB_Key" -I"C:\Users\wolf\Documents\Arduino\libraries\KB_Row" -I"C:\Users\wolf\Documents\Arduino\libraries\KB_Matrix" -I"C:\Users\wolf\Documents\Arduino\libraries\KB_Keybrd" -I"C:\Program Files (x86)\Arduino\libraries" -I"C:\Program Files (x86)\Arduino\hardware\arduino\libraries" -I"C:\Program Files (x86)\Visual Micro\Visual Micro for Arduino\Micro Platforms\default\debuggers" -I"C:\Users\wolf\Documents\Arduino\libraries" -o e\ScanCode.cpp.o"  "C:\Users\wolf\Documents\Arduino\libraries\KB_ScanCode\ScanCode.cpp"  -DF_CPU=16000000L -DUSB_SERIAL_HID -DLAYOUT_US_ENGLISH -DVISUALMICRO_COMPILER_VER=1
ScanCode.cpp:In file included from
ScanCode.h:4:22: warning: Keyboard.h: No such file or directory
ScanCode.cpp:In member function 'void ScanCode::updateOSShifted(bool)'
ScanCode.cpp:11: error: 'Keyboard' was not declared in this scope
ScanCode.cpp:16: error: 'Keyboard' was not declared in this scope
C:\Program Files (x86)\Arduino\hardware\tools\avr\bin\avr-g++ -c -g -Os -fno-exceptions -ffunction-sections -fdata-sections -Wall -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=106 -I"C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino" -I"C:\Program Files (x86)\Arduino\hardware\arduino\variants\standard" -I"C:\Program Files (x86)\Arduino\libraries\Wire" -I"C:\Users\wolf\Documents\Arduino\libraries\KB_ScanCode" -I"C:\Users\wolf\Documents\Arduino\libraries\KB_Key" -
« Last Edit: Oct 11th, 2014 at 7:36pm by wolf »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 11676
Location: United Kingdom
Joined: Apr 10th, 2010
Re: error: 'Keyboard' was not declared in this scope
Reply #8 - Oct 11th, 2014 at 7:38pm
Print Post  
Looks like uno board selected not teensy. Select teensy then save project so the setting is retained.
  
Back to top
WWW  
IP Logged
 
wolf
Junior Member
**
Offline


Posts: 33
Joined: Sep 19th, 2014
Re: error: 'Keyboard' was not declared in this scope
Reply #9 - Oct 11th, 2014 at 9:55pm
Print Post  
Thank you.  That fixed it Smiley.

I installed/updated to TeensyDuino 1.20 two days ago.
It's in the Verbose Message:
Quote:
"C:\Users\wolf\AppData\Local\VMicro\Arduino\Builds\kb\teensy2\kb.cpp"  -DF_CPU=16000000L -DUSB_SERIAL -DLAYOUT_US_ENGLISH -DVISUALMICRO_COMPILER_VER=1  -DTEENSYDUINO=120

The "Micro Boards" field said "Teensy 2.0" the whole time, so the fix was non-obvious.
« Last Edit: Oct 11th, 2014 at 10:00pm by wolf »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 11676
Location: United Kingdom
Joined: Apr 10th, 2010
Re: error: 'Keyboard' was not declared in this scope
Reply #10 - Oct 11th, 2014 at 10:02pm
Print Post  
Yes I've seen that situation and will sort it for the next release
  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 11676
Location: United Kingdom
Joined: Apr 10th, 2010
Re: error: 'Keyboard' was not declared in this scope
Reply #11 - May 25th, 2015 at 11:23pm
Print Post  
The latest release used menus for "board options menus" instead of defines. You should upgrade to the latest Teensy currently 1.23 + Arduino 1.6.4 Ide. Existing project defines can then be removed. Please see the Teensy page and the release notes.

The latest release is especially recommended because it requires zero knowledge to configure (unlike the previous 1.0 system)  Smiley
« Last Edit: May 26th, 2015 at 3:54pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint