Brothersoft.comWindows|Mac|Mobile|Games

|Message

Solve software problem quickly Share experience to help others Improve the ability of solving problem
Write Arduino Software in C

08/24/2011 03:59 by jvanhorn

First answer posted by tdintx at 08/24/2011 03:59
Add Your Answer
10~1000 characters in length CAPTCHA:
1 Answers
  • tdintx
    1. Download all the necessary software and files. This includes:
      • The latest Arduino software package [1], which includes all the pre-made C++ files that make arduino run, as well as the simple Java GUI aimed at non-programmers. Once the other files are installed, this is the only file you'll need from now on!
      • AVR-GCC, which is the compiler for the AVR-series of microcontrollers (heart of an Arduino). For Windows users, get WinAVR [2]
      • The Eclipse C++ Language IDE [3], where you will be doing your coding and uploading the code to your Arduino! Eclipse requires that you have the Java Runtime Environment [4] installed
      • The AVR-Eclipse Plugin [5], which provides the functionality the Eclipse IDE needs to talk to your Arduino
    2. Extract the files for your Eclipse IDE into its own dedicated folder. Then, extract the files for the AVR-Eclipse plugin into the same folder (or copy the contents into that folder).
    3. Create a C++ Project in Eclipse, and use the following settings;
      • Make the project type a "AVR Cross Target Application"
      • Ensure "Debug" is UN-CHECKED when selecting Build Configurations (and ensure "Release" IS CHECKED)
      • When asked for hardware details, make sure you select the correct frequency (typically 16000000 Hz) and the correct microcontroller, according to your arduino type [6]
    4. Extract the latest version of the arduino software from their website. Copy the entire '\hardware\arduino\cores\arduino' folder into your project folder. Now that Eclipse is installed and the plugin is configured, from now on this is the only folder needed to start new Arduino projects from scratch!
    5. Create a main.h file that declares void setup(), int main() and void loop(). include "WProgram.h" (with quotes) in this header as well; this links it to all the arduino code
    6. Fix compiler-errors in arduino software. As of arduino v0018, this will include the following changes;
      • main.cpp; delete "#include " at the top, and ensure your "main.h" is included instead
      • Tone.cpp; change the last two includes, & , to have quotes instead of brackets ("wiring.h" & "pins_arduino.h")
      • Print.h; the function declaration "void function(int inputs) = 0;" must be changed to "void function(int inputs);", or in other words delete the "= 0" so its not a pure-virtual function
  • Was this answer helpful? 00 · 08/24/2011 03:59
Add Your Answer
10~1000 characters in length CAPTCHA:
Related Questions
Q:write c program to show result of a stored procedure "PROC_RESET_MAIL" on database "USER_NOTIFY"

A:#include<stdio.h? #include<conio.h> void main() { int i=0; switch(i) { case 0: i++; printf("%d..",i); case 1: printf("%d..",i); case ...(more)

Q:How to Organize Digital Images with XnView?

A:1. Start up the program. 2. Navigate to your pictures. This could be in a place selected by you, and/or in My Documents >> My Pictures ...(more)

Q:How to Remove Sbmntr.exe

A: If you have not done so already, purchase or download a complete anti-virus software package. Programs such as Norton Anti-Virus offer full ...(more)

Q:What are Features of a QuickBooks Accounting Package?

A:QuickBooks accounting software comes in five different versions. The Pro version can accommodate up to three simultaneous users; the Plus, Pre...(more)

Q:How to Delete Extra Programs on New Computers?

A:For Windows Users Click on the "Start" menu usually located in the bottom left corner of your desktop screen if your settings have not been ...(more)

Added Successfully!

×

Are you sure to delete your answer?

NoYes

×

Are you sure to choose it as the best answer?

NoYes

×

Voted Successfully!

×

You can't vote for yourself

×

You can't choose your own answer

×