Go Down

Topic: ARDUINO C (Read 854 times) previous topic - next topic

elico

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

Coding Badly

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


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

bill2009

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.

AWOL

Quote
the use of setup/loop instead of main

They're in addition to main, not instead of.
"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.

Jantje


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: [Select]
#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
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 -

Go Up