Society of Robots - Robot Forum
Software => Software => Topic started by: roboplane2.0 on March 25, 2007, 12:41:57 PM
-
im a little confused with cprogramming codes and all that ive been looking at some tutorials on it every time i try to do something with the tutorial on Arduino-007 Alpha it keeps saying error:invalid fuction declaration could someone help me with that?
-
generaly when you have a problem with code you need to post the code and the error. other wise we can't really figure it out...
-
#include
<stdio.h>
int main()
{
printf( "I am alive! Beware.\n" );
getchar();
return 0;
}
error:invalid fuction declaration
and what is a pseudocode
-
try puting the #include <stdio.h> all on one line other-wise printf() or getchar() are not defined in stdio.h for your micro controller. What you can do is find where stdio.h is and see what it has declared....
-
i dont get what you said
-
ok so printf() and getchar() are functions right?
well pretty much what it's telling you is that it can't find those functions.
So either stdio.h doesn't have those functions
*or*
you are not including stdio.h in the right way
*or*
stdio.h simply doesn't exist with the compiler you are using.
-
im using Arduino-0007 Alpha. Heres the link:
http://www.arduino.cc/en/Main/Software (http://www.arduino.cc/en/Main/Software)
-
I'm not really familiar with arduino. but I'm guessing you should look at some of thier tutorials before assuming that thier "Processing" language runs like straight C code. For one you are programing on a microcontroller so what exactly is printf supossed to do? If sdtout and stdin are defined to be serial connections I'd imagine that would work, the problem is that for the most part microchips won't use printf and getchar because they are too limiting without an operating system. I would ask your question here: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl and you will probably get a more detailed response.
-
Yeah, seriously, start from the ground up.........the first thing you should do is blink an LED
http://www.arduino.cc/en/Tutorial/HomePage
Once you've played about with it for a while, then take a look at this page
http://www.arduino.cc/en/Reference/HomePage
To make your own stuff. This is how I would personally go about it :)
Good luck!