Pages: [1]   Go Down
Author Topic: ARDUINO C  (Read 825 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 2
Posts: 158
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all

How far is the ARDUINO C sytax from the "regular" C
 like KEIL C for example .

Th reason I ask is because I wonder about a newbe to ARDUINO
 when he learns by practice the ARDUINO C , how hard it will be to him
 when he will need to do some work with other controllers like 8051
  with KEIL compiler for example .

Thanks
Elico
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 210
Posts: 13030
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

How far is the ARDUINO C sytax from the "regular" C

It as far from "regular" C as "regular" C is from "regular" C++.
Logged

ottawa, canada
Offline Offline
God Member
*****
Karma: 6
Posts: 993
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The arduino language is really c++. I worked my way thru a c/c++ tutorial nook running the examples on the arduino. The biggest things i noticed were the use of setup/loop instead of main and the lack of standard stream i/o on the arduino.
Logged

Bill Rowe
Olduino - An Arduino for the First of Us
www.olduino.wordpress.com

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 309
Posts: 26495
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
  the use of setup/loop instead of main
They're in addition to main, not instead of.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Belgium
Offline Offline
Edison Member
*
Karma: 68
Posts: 1926
Arduino rocks; but with my plugin it can fly rocking the world ;-)
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
  the use of setup/loop instead of main
They're in addition to main, not instead of.
Actually the Arduino library contains a main.cpp which contains a main which calls setup and loop.
Code:
#include <Arduino.h>

int main(void)
{
init();

#if defined(USBCON)
USBDevice.attach();
#endif

setup();
   
for (;;) {
loop();
if (serialEventRun) serialEventRun();
}
       
return 0;
}
Delete the file and you have to program your own main.
Best regards
Jantje
Logged

Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

Pages: [1]   Go Up
Jump to: