Pages: [1]   Go Down
Author Topic: convert pde to cpp  (Read 2106 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi everyone,


I want to convert the pde file to cpp and then under visual studio made some things, and then using avr-gcc and avrdude upload this software to arduino.

thanks for answers

best regards
malin
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 653
Posts: 50881
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The pde file IS C++ code. The IDE adds some code to it, such as a main function that calls init(), setup() (your function), loop() (your function), and generates function prototypes for your other functions, if any. It adds some header file include statements.

Adding these additional things yourself isn't difficult.

Have you figured out how you are going to make Visual Studio invoke avr-gcc?
Logged

0
Offline Offline
Jr. Member
**
Karma: 1
Posts: 74
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i have makefiles that I use to build things  .  The makefile takes the PDE and applies the requisite things to make a CPP file.. you could easily modify the makefile to just use the sketch.cpp file and not go through the conversion.

It also does the upload.
One thing to note, to make things work with multiple boards, (Mac paths) I make unique copies of the libraries in /Applications/Arduino.app/contents/Resources/Java/Hardware and select those using the MCU variable defined in the Makefile.

PM me with your email and I will send the makefile
Logged

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 137
Posts: 6805
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

to convert .pde to .cpp:

1) add "#include WProgram.h" at the top.
2) add any needed function prototypes for forward references.

That's it.  The rest of the magic is including the correct include directories, core files,  and libraries in the compile commands.  Hold down the shift key while doing "verify" to get verbose output of what goes on during the sketch compile.

And see http://arduino.cc/en/Hacking/BuildProcess
Logged

Pages: [1]   Go Up
Jump to: