Home \ Help \ Search \ Login RSS

Welcome, Guest. Please Login

This forum is now READ-ONLY! Please visit http://forum.wiring.co/ for the new forum.

Wiring ForumProgramming Questions & HelpSyntax › Direct compiling C++ and upload

Page Index Toggle Pages: 1
Direct compiling C++ and upload (Read 4633 times)
05/07/08 at 10:54:43

julienb   Offline
Junior Member
wiring AND arduino owner
France

Posts: 81
**
 
hello,

newbie question:

If I want to directly code in C++, how could I do?

I understand that :
you code in wiring language
you click run, wiring environment translate your code in C++

but How can i do directly that and upload it on the board?

 

IP Logged
 
Reply #1 - 05/07/08 at 17:57:57

worapoht   Offline
YaBB Newbies
Thailand

Posts: 21
*
 
umm.. can you explain more about "direct code" is..
because Wiring base on AVRGCC that are C/C++ itself

Wiring add built-in libraries and prepare init(); setup(); and loop(); in real main();

you still write code refer to register like this,
DDRB|=0x01;
PORTB&=0xfe;

or may define your own class items,
class demo
{
public:
  unsigned char write(unsigned char i)
  {
    return ++i;
  }
};

prototype overload function, etc.. that's work as I write on Eclipse C/C++ wtih AVR plugins

what's are u looking for?
 
IP Logged
 
Reply #2 - 05/07/08 at 18:03:52

julienb   Offline
Junior Member
wiring AND arduino owner
France

Posts: 81
**
 
I mean:
when I code stuff in Wiring environment, and click on run, it creates an "applet" directory with, inside, a pretty *.cpp file

this is C++ code.
with include *.h etc

can I do that directly in Wiring environment ? or do I have to code in Wiring environment, click on run, and modify the *.cpp file?

in the second case, how could I  compile *.cpp in order to make a *.hex and how could I send the *.hex to the board?
 

IP Logged
 
Reply #3 - 05/08/08 at 08:34:12

worapoht   Offline
YaBB Newbies
Thailand

Posts: 21
*
 
I see..

direct main code C/C++ .c/.cpp format or have main() not allow on Wiring.
because Wiring known only .pde as current sketch and combine into "real" main.c and compile later..
just .cpp , .h as library can be added <#include  ...>

for second question, "Verify" is pre-compile check and not generate new .hex file.
for .hex upload, on now, you need to run individual command line to upload .hex using avrdude command with some parameter (for WiringV1 using uisp instead)

Why do you need something hard-way like that?
Wiring do less and get work already..

one good reason for .pde is unique type, it's run on known platform/hardware Wiring (or Arduino) that user just write code and run.. no hugh project setup need on C/C++ project that may trouble on user..

Wiring call source file as "Sketch" and save in ".pde" for relate to Processing in the same environment.

for better answer, you may ask Barragan H.  Smiley
 
IP Logged
 
Reply #4 - 05/08/08 at 08:52:59

julienb   Offline
Junior Member
wiring AND arduino owner
France

Posts: 81
**
 
hello worapoht,

I don't need it now.
I just wanted to understand how it works.

indeed, I'm and I'll be a *.pde coder (processing & wiring!)
this environment is here to help us  Wink
 

IP Logged
 
Page Index Toggle Pages: 1