Anything else besides Arduino ? I am developing code using gcc. So, can I just use plain gcc to create hex files ?
Arduino + Teensyduino from Paul is all you need.
All is cpp, but you can put plain c into separate .c files
Assume you have a standalone test program with main and not setup/loop:
a way to port such standard main to Arduino concept:
either divide your cpp program into setup function and into functions that are called repetitively via the loop().
of if to difficult
simple workaround
open from Arduino new program
you will get an empty sketch labelled say "sketch_oct28a" for today
save the sketch, this creates a directory sketch_oct28a or the name you choose,in your local Arduino folder
copy your *.cpp program (say myApp.cpp) into this folder.
open this file with Arduino (opens a new window with the basic *ino file and the new myApp.cpp file in the tabs)
select your myApp.cpp file and change main to, say 'myApp'
select the ino file and insert in setup a call to myApp
Your ino program is now something like this
Code:
int myApp(void);
void setup() {
// put your setup code here, to run once:
myApp();
}
void loop() {
// put your main code here, to run repeatedly:
}
and you separate program is something like this
Code:
#include "arduino.h"
void blink (uint32_t del) { digitalWriteFast(13,!digitalReadFast(13)); delay(del);}
int myApp(void)
{
pinMode(13,OUTPUT);
while(1)
{
for(int ii=1; ii<10; ii++)
blink(10*ii);
}
return 0;
}
verify or download, that is all.
Yes, I know, there a lot of steps to do, and I only mention it because it is an option.
If non-Arduino program will run on teensy, that is another question.
IMO, the best thing is to start simple, analyse your program, divide it into setup functions and into recurring operations that may go into loop().
If you do not like Arduino environment, you can always use a makefile setup, and there are some other IDE's promoted in this forum.
There is a makefile in Teensy3/core in the Arduino folder.