Here's how I got Free MS Visual Studio 2013 Community edition + the Visual Micro plug-in for Arduinio/Teensyduino working.
Most of the below is done once.
I used Windows 7
From the Arduino 1.6.1 installation folder, e.g., C:\Arduino as above...
use a text editor such as Programmers Notepad to open
C:\arduino\hardware\teensy\avr\boards.txt
(yes, we're working on Teensy 3/LC but the path says AVR - never mind!)
in the teensy 3.0 section add this
teensy30.build.flags.ldspecs=
in the teensy 3.1 section add this
teensy31.build.flags.ldspecs=
in the teensy LC section add this
teensyLC.build.flags.ldspecs=
change to match this:
#teensy31.build.flags.defs=-D__MK20DX256__ -DTEENSYDUINO=121
#uncomment this [next] line and remove the one above, for use with Visual Micro
teensy31.build.flags.defs=-D__MK20DX256__ -DTEENSYDUINO=121 -DF_CPU=96000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH
Do the same as above for Teensy 3.0 and Teensy LC sections
Save the edited file with no name change.
Copy the edited file to your own place not in the C:\Arduino path.
Whenever you reinstall a new version of Arduino/Teensyduino, replace the boards.txt file that gets installed with the saved edited version so you don't have to repeat the edits.
======
NOTE: with the boards.txt file as above defining the CPU speed and so on, don't put the same info into the Visual Studio / Visual Micro project properties as mentioned on the visual micro website link as above.
======
Run visual studio 2013 from the start menu.
there is a Visual Micro toolbar. Leftmost is a drop-down. Choose Arduino 1.6. Right of that, choose Teensy 3.1 or LC.
TOOLS->Visual Micro->Configure IDE Locations
We've chosen Arduino 1.6 for now, so in the dialog box, enter the path to that Arduino 1.6.1 installation, such as c:\Arduino. Click OK.
The above need only be done once, or if the installation path changes due to your choice.
FILE->new->sketch name it something like zzz1
type in a simple blinky test for the LED on pin 13 or whatever for the board you're using
(or paste in some code).
BUILD->zzz1
Hopefully it compiles/links without error (except your typos).
connect Teensy via USB.
DEBUG->start without debugging
The Teensy loader should run, maybe with Windows asking permission, then download zzz1.hex and it runs. We hope.
===
Now I had to customize the toolbar menus and toolbar icons to enable the icons for build and the serial terminal window(s). You can have many serial terminals open if you are testing with multiple teensy's. The serial terminals automatically reconnect after a download. They also have smart scrolling - hard to explain, but click on text area and scrolling stops, then click on bottom and it resumes.
This done, I'm back to what I had with Atmel Visual Studio 6.2 with Visual Micro, for Teensyduino 1.06. But using Visual Studio 2013 and no ties to Atmel's tool.
I hope this helps.
Someday, Visual Micro and Teensy may eliminate the need for hand-editing boards.txt. That's really the only thing done here that's outside the default/normal installations.
Steve
Most of the below is done once.
I used Windows 7
- Install Arduino 1.6.1. I used c:\Arduino as the location. I have older versions in other folders like C:\Arduino_106 but these are N/A.
- Install Teensyduino 1.21.
Confirm that the Arduino 1.6.1 IDE will run and compile for Teensy 3 and/or LC. - Install MS Visual Visual Studio 2013 Community edition
- Install Visual Micro plugin for the above.
Nothing special about the last two. Below, I'll show how I got these two to work with Arduino 1.6.1 and Teensy 1.21.
http://www.visualmicro.com/page/Teensy-for-Microsoft-Visual-Studio.aspx
From the Arduino 1.6.1 installation folder, e.g., C:\Arduino as above...
use a text editor such as Programmers Notepad to open
C:\arduino\hardware\teensy\avr\boards.txt
(yes, we're working on Teensy 3/LC but the path says AVR - never mind!)
in the teensy 3.0 section add this
teensy30.build.flags.ldspecs=
in the teensy 3.1 section add this
teensy31.build.flags.ldspecs=
in the teensy LC section add this
teensyLC.build.flags.ldspecs=
change to match this:
#teensy31.build.flags.defs=-D__MK20DX256__ -DTEENSYDUINO=121
#uncomment this [next] line and remove the one above, for use with Visual Micro
teensy31.build.flags.defs=-D__MK20DX256__ -DTEENSYDUINO=121 -DF_CPU=96000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH
Do the same as above for Teensy 3.0 and Teensy LC sections
Save the edited file with no name change.
Copy the edited file to your own place not in the C:\Arduino path.
Whenever you reinstall a new version of Arduino/Teensyduino, replace the boards.txt file that gets installed with the saved edited version so you don't have to repeat the edits.
======
NOTE: with the boards.txt file as above defining the CPU speed and so on, don't put the same info into the Visual Studio / Visual Micro project properties as mentioned on the visual micro website link as above.
======
Run visual studio 2013 from the start menu.
there is a Visual Micro toolbar. Leftmost is a drop-down. Choose Arduino 1.6. Right of that, choose Teensy 3.1 or LC.
TOOLS->Visual Micro->Configure IDE Locations
We've chosen Arduino 1.6 for now, so in the dialog box, enter the path to that Arduino 1.6.1 installation, such as c:\Arduino. Click OK.
The above need only be done once, or if the installation path changes due to your choice.
FILE->new->sketch name it something like zzz1
type in a simple blinky test for the LED on pin 13 or whatever for the board you're using
(or paste in some code).
BUILD->zzz1
Hopefully it compiles/links without error (except your typos).
connect Teensy via USB.
DEBUG->start without debugging
The Teensy loader should run, maybe with Windows asking permission, then download zzz1.hex and it runs. We hope.
===
Now I had to customize the toolbar menus and toolbar icons to enable the icons for build and the serial terminal window(s). You can have many serial terminals open if you are testing with multiple teensy's. The serial terminals automatically reconnect after a download. They also have smart scrolling - hard to explain, but click on text area and scrolling stops, then click on bottom and it resumes.
This done, I'm back to what I had with Atmel Visual Studio 6.2 with Visual Micro, for Teensyduino 1.06. But using Visual Studio 2013 and no ties to Atmel's tool.
I hope this helps.
Someday, Visual Micro and Teensy may eliminate the need for hand-editing boards.txt. That's really the only thing done here that's outside the default/normal installations.
Steve