0
Offline
Newbie
Karma: 0
Posts: 22
Arduino rocks
|
 |
« on: October 05, 2008, 11:16:21 am » |
Hi - I am wondering how do I use AVR studio to connect to my arduino and program it in C++... I would appreciate as in depth as posible...
I have arduino dicemilla.
|
|
|
|
|
Logged
|
|
|
|
|
Bangkok, Thailand
Offline
Newbie
Karma: 0
Posts: 47
Arduino POP!
|
 |
« Reply #1 on: October 05, 2008, 02:52:22 pm » |
AVR Studio support only C project not C++. Alternate choice is Eclipse + AVR plugin and WINAVR can use both C C++
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 22
Arduino rocks
|
 |
« Reply #2 on: October 05, 2008, 06:20:34 pm » |
Ok - just tell me a way to get real C or C++ code on my arduino on windows...
|
|
|
|
« Last Edit: October 05, 2008, 06:43:54 pm by brianfast »
|
Logged
|
|
|
|
|
0
Offline
God Member
Karma: 0
Posts: 507
|
 |
« Reply #3 on: October 05, 2008, 07:15:26 pm » |
I think the arduino environment qualifies as "real" C, C++.
start small, get blink working, from the arduino menus: file->sketchbook->Examples->Digital->Blink file->upload to I/O board
observe blinkness of onboard LED, play with delay values and re-upload/re-observe.
|
|
|
|
|
Logged
|
|
|
|
|
Austin, TX USA
Offline
God Member
Karma: 3
Posts: 992
Arduino rocks
|
 |
« Reply #4 on: October 05, 2008, 08:54:52 pm » |
I think the arduino environment qualifies as "real" C, C++. Absolutely right! It's not overly well publicized fact, but the Arduino IDE -- the package that you download on the main arduino.cc site -- is pure, unadulterated C++! (Well, very slightly adulterated.) It took me a few days to figure this out, but boy am I happy about that! Mikal
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 22
Arduino rocks
|
 |
« Reply #5 on: October 05, 2008, 09:05:07 pm » |
I want more functions than just void loop and void setup.
I want to program in pure c or c++...
I'm wondering why this isn't documented anywhere...
|
|
|
|
|
Logged
|
|
|
|
|
Austin, TX USA
Offline
God Member
Karma: 3
Posts: 992
Arduino rocks
|
 |
« Reply #6 on: October 05, 2008, 09:14:30 pm » |
I wish the documentation was more clear about that, too, techx. I think a lot of C++ programmers would be attracted to this if they only knew it was C++! Yes, you must provide a loop() and setup() function (and you can't provide a main()). But beyond that, you can do almost anything C++ you want. Make any functions, classes, create objects, call runtime library functions, etc. etc. Try it! It's all good!  Mikal
|
|
|
|
« Last Edit: October 05, 2008, 09:16:20 pm by mikalhart »
|
Logged
|
|
|
|
|
0
Offline
God Member
Karma: 0
Posts: 507
|
 |
« Reply #7 on: October 06, 2008, 07:28:19 am » |
Well, it does say in the language reference that it is based on C++, as well as in the introduction page and the environment page and the build process page and probably a bunch of other pages too. and like pretty much any language, write whatever functions you need. But start with getting blink working, the "hello world" of microprocessors, and leverage the getting started page: http://arduino.cc/en/Guide/HomePage
|
|
|
|
« Last Edit: October 06, 2008, 07:30:50 am by dcb »
|
Logged
|
|
|
|
|
London
Offline
Faraday Member
Karma: 6
Posts: 6226
Have fun!
|
 |
« Reply #8 on: October 06, 2008, 07:58:52 am » |
I wish the documentation was more clear about (C++)... Given the power available under the hood, it's sometimes easy to forget that the Arduino is targeted at an audience that may not have or want computer science expertise. For those more interested in tinkering then learning a sophisticated object oriented programming language, C++ appears as more a deterrent than an attraction. I think the Arduino documentation has it pitched just right, focus on what you can do and how to do it, and don't let the technology get in the way. For those of us that are as interested programming languages as we are in what we can make with them, discovering there's C++ under the skin is easy to find. I do agree with Mikal that it is a pleasant and welcome surprise. But lets be careful that we don't create an impression that any knowledge of C++ is important for making a successful arduino project.
|
|
|
|
« Last Edit: October 06, 2008, 07:59:13 am by mem »
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 22
Arduino rocks
|
 |
« Reply #9 on: October 06, 2008, 04:39:39 pm » |
Look I asked a question:
How do I program in pure C or C++.
I do not want to write a hello world in Arduino language. I want to write a real c program with main()..
I don't need suggestions to get started with the arduino language. I have already done multiple things with it. Pretty soon I will have to program in real C++ on another project and I want to be able to use C/C++ asap.
|
|
|
|
« Last Edit: October 06, 2008, 04:44:14 pm by brianfast »
|
Logged
|
|
|
|
|
London
Offline
Faraday Member
Karma: 6
Posts: 6226
Have fun!
|
 |
« Reply #10 on: October 06, 2008, 04:53:32 pm » |
I see a number of good answers to your question in the replies above. But allow me to repeat, you can write C++ using the Arduino IDE or use one of the other IDE's mentioned. But because the Arduino is not targeted at people wanting to learn C++, there may not be a simple tutorial explaining how do it.
|
|
|
|
« Last Edit: October 06, 2008, 04:54:00 pm by mem »
|
Logged
|
|
|
|
|
0
Offline
Sr. Member
Karma: 0
Posts: 375
|
 |
« Reply #11 on: October 06, 2008, 04:56:35 pm » |
I would suggest you head over to http://www.avrfreaks.net/ if you are not interested in the Arduino IDE. Without the bootloader and IDE it is not really an Arduino any more and simply becomes a breakout board for the 168. As this forum is centered around the Arduino you will find much more information about AVR Studio on the avrfreaks site than you will here.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 22
Arduino rocks
|
 |
« Reply #12 on: October 06, 2008, 05:33:26 pm » |
all i want is: 1. tell me how to compile c or c++ file for arduino chip 2. tell me how to get it on arduino with included usb port or tell me its impossible.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
God Member
Karma: 0
Posts: 507
|
 |
« Reply #13 on: October 06, 2008, 05:44:25 pm » |
try google
|
|
|
|
|
Logged
|
|
|
|
|
Grenoble/Lyon - France
Offline
Sr. Member
Karma: 0
Posts: 363
|
 |
« Reply #14 on: October 06, 2008, 06:23:17 pm » |
Damn, people those days. No respect for anyone...
Anyway, my guess would be that you use AVRstudio to compile a winhex file, ready to upload, then, you take this file and upload it via avrdude-ser-jtag, and voilà
(I won't put the link to the avrdude-ser-jtag method, just do a bit of searching by yourself)
|
|
|
|
« Last Edit: October 06, 2008, 06:25:25 pm by melka »
|
Logged
|
|
|
|
|
|