How do I use AVR studio?

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! :slight_smile:

Mikal

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:

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.

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.

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.

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.

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.

try google

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)

dcb get a life

i have searched this forum avr freaks forum google and the arduino site for help...

get a clue asshole

This thread is starting to remind of a thread from a couple weeks ago where someone started acting rude when the answers were not to their liking. If techx responds that I am clogging the internet with this post, we will have a winner! ;D

dcb is rude. anyone telling someone to google it for a question that is not obvious is rude. I hate people like dcb. Anyway I assume that I need to use the ICSP to program and that is my problem as I am using USB. So this thread is no longer needed.

I don't get it techx, I've been trying to help you and figure out where you are coming from and what you are asking. But instead of saying "thank you", you act like I owe you something and should read your mind and type out detailed instructions which you still might not understand.

Google is your friend, search for arduino and c++ or avrstudio or whatever and read.

I appreciate you are on a frustrating part of the learning curve, but there is no cause for personal attacks, let alone hate.

telling people to use google is an insult to their intelligence.

no excuse

An Arduino sketch IS exactly a C++ program, except that it already includes (as part of the runtime environment) a function main() defined as:

int main(void)
{
      init();     // Part of arduino environment
      setup();  // Provided by you in the sketch
      for (;;)
        loop();  // Provided by you in the sketch
      return 0;
}

This isn't really any different that the code that a more traditional compiler environment executes in your program before it calls main() (usually something like _start(), contained in the crt0 library); it's just a convenience for embedded applications (for instance, you no longer have to explain to people what should happen when the program is "done"; it's clear that it just keeps calling loop() forever.)

westfw, thanks for sharing that little nugget, lots of things just made all kindza sense for me.

techx, if you're not finding what you need here, the polite thing to do is thank people for their time trying to help and try something else.

goodbye arduino forum

Goodbye techx, you are welcome!

This is what I think techx was asking about

http://www.arduino.cc/playground/Code/Eclipse

Good luck!