Arduino Tips & Tricks:
Where is the main() function in the arduino codes?
While writing a code on AVR studio or keil uvision every code should have a main function. And during the days when i started programing my teacher told me that every c /c++ code should have a main() function and there should be one and only one main in any program. While writing big programs the programmers tend to write different parts of program in different tabs for better readability and understanding and sometimes write #include<abc > in the tab where main function is written to include those files
But in an arduino environment you never find something like below
void main()
{
}
well does that mean it does't have one. It seems so but it is not actually like that as basics never go out of fashion. It is just another way of arduino to make things simple by hiding the void main. Actually what happens behind the scene is something like belowint main(void) { init(); setup(); for (;;) { loop(); } return 0; }
No comments:
Post a Comment