Go Down

Topic: arduino has main function...??? (Read 3806 times) previous topic - next topic


hi all,
        i have arduino mega 2560 development kit. i m new for this hardware. i want to know when we programming in arduino ,so can we define a function which name is main like 8051 or other controllers.
coz in this i saw the loop & setup functions... so my questions is. can we have permission to access in to main function coz without main function "C" code doesn't work.

if we can access to main function then plz anyone give a code like this format.


When you compile a sketch, a main() function is created. The init() and setup() functions are called, and then loop() is called in an endless loop.

What is it that you want to do in main() that can not fit in setup() or loop()?


Yes, there is a "main", but it isn't clear to me why you need access to it.
Code: [Select]
int main(void)

for (;;)
return 0;

You provide "setup" and "loop".
"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.


Thanks to all  for your support ....

actually when i start, so i had an query that why i asked this.

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!

via Egeo 16
Torino, 10131