Go Down

Topic: ARDUINO C (Read 997 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
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy