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
  • 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
Normal Topic Programming Teensy boards (Read 7090 times)
paradajz
Newbies
*
Offline


Posts: 5
Joined: Feb 6th, 2014
Programming Teensy boards
Nov 13th, 2014 at 7:47pm
Print Post  
Hello. I have tried to follow the guide written here:
http://www.visualmicro.com/page/Teensy-for-Microsoft-Visual-Studio.aspx

However, tutorial doesn't mention how to set Teensy to MIDI mode, that is, I don't know which defines to use.

Also, I don't know what is the difference between two settings in attachments, could someone please clarify that for me? Thanks.
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Programming Teensy boards
Reply #1 - Nov 13th, 2014 at 8:07pm
Print Post  
Hi,

Thanks for your questions.

1)

The defines required for a teensy board can be viewed in one or two ways. a. is recommended for users new to teensy so that they first can understand their hardware and its options.

a. In the teensy ide, use the menus to understand and select your desired settings Then switch on "file>preferences>verbose compile" then build and build. Then you can see the -D defines from one of the verbose output lines. In Visual Micro you add the defines without the -D and with a semi-colon ; for each.

b. Open [teensy-ide-folder]\hardware\teensy\boards.txt in a text editor. Then find the board you are using which looks to be teensypp2.name=Teensy++ 2.0

In the boards.txt you will see the menu.usb entries. for example the USB_MIDI option below is what you will need for the MIDI usb option.

Code
Select All
teensypp2.menu.usb.serialhid.name=Serial + Keyboard + Mouse + Joystick
teensypp2.menu.usb.serialhid.build.define0=-DUSB_SERIAL_HID

teensypp2.menu.usb.midi.name=MIDI
teensypp2.menu.usb.midi.build.define0=-DUSB_MIDI

 



With teensy you get to set the speed of the cpu you want to use via F_CPU and a USB option. If you elect for a USB option that allows the Teensy to emulate a keyboard then you also provide which language you want the keyboard to emulate.

2)

The difference between Arduino 1.0.x mainly affects the Teensy 32bit 3.x boards and will probably has little impact for you with your Teensy++ 2.0. However you don't need both and I recommend you use the Teensy option so that you know it points to a Teensy modified Arduino Ide.
  
Back to top
IP Logged
 
paradajz
Newbies
*
Offline


Posts: 5
Joined: Feb 6th, 2014
Re: Programming Teensy boards
Reply #2 - Dec 24th, 2014 at 6:09pm
Print Post  
Hey, sorry for the late reply. Thanks for clarification, however, I'm still unable to make it work as MIDI device. I've tried setting

F_CPU=16000000L;USB_MIDI;

after which I get weird compile errors:

Code
Select All
keylayouts.c:In file included from
keylayouts.h:5414: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'keycodes_ascii'
keylayouts.h:5415: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'keycodes_iso_8859_1'
keylayouts.c:11: error: expected ',' or ';' before 'keycodes_ascii'
Error compiling core
 



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


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Programming Teensy boards
Reply #3 - Dec 24th, 2014 at 6:20pm
Print Post  
Hi, maybe your code needs a keyboard layout -D ?

To make it compile in the teensy ide which menu items are you setting?
  
Back to top
IP Logged
 
paradajz
Newbies
*
Offline


Posts: 5
Joined: Feb 6th, 2014
Re: Programming Teensy boards
Reply #4 - Dec 24th, 2014 at 8:29pm
Print Post  
Tim@Visual Micro wrote on Dec 24th, 2014 at 6:20pm:
Hi, maybe your code needs a keyboard layout -D ?

To make it compile in the teensy ide which menu items are you setting?


Hm, I tried with:

F_CPU=16000000L;USB_MIDI;LAYOUT_US_ENGLISH

and it compiles okay. However, I can't test it right now on a board, will report back in few days.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint