go away spammer

Author Topic: Cprogramming  (Read 6212 times)

0 Members and 1 Guest are viewing this topic.

Offline roboplane2.0Topic starter

  • Jr. Member
  • **
  • Posts: 27
  • Helpful? 0
  • Henry the Robot
Cprogramming
« 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?
If you're a Halo Fan, click here http://www.freewebs.com/halowireless/forum.htm.

Offline JesseWelling

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 707
  • Helpful? 0
  • Only You Can Build A Robot!
Re: Cprogramming
« Reply #1 on: March 25, 2007, 01:04:42 PM »
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...

Offline roboplane2.0Topic starter

  • Jr. Member
  • **
  • Posts: 27
  • Helpful? 0
  • Henry the Robot
Re: Cprogramming
« Reply #2 on: March 25, 2007, 01:07:37 PM »
 #include
<stdio.h>

int main()
{
  printf( "I am alive!  Beware.\n" );
  getchar();
  return 0;
}


error:invalid fuction declaration



and what is a pseudocode

« Last Edit: March 25, 2007, 01:35:52 PM by roboplane2.0 »
If you're a Halo Fan, click here http://www.freewebs.com/halowireless/forum.htm.

Offline JesseWelling

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 707
  • Helpful? 0
  • Only You Can Build A Robot!
Re: Cprogramming
« Reply #3 on: March 25, 2007, 02:00:38 PM »
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....
« Last Edit: March 25, 2007, 02:40:13 PM by JesseWelling »

Offline roboplane2.0Topic starter

  • Jr. Member
  • **
  • Posts: 27
  • Helpful? 0
  • Henry the Robot
Re: Cprogramming
« Reply #4 on: March 25, 2007, 02:32:01 PM »
i dont get what you said
If you're a Halo Fan, click here http://www.freewebs.com/halowireless/forum.htm.

Offline JesseWelling

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 707
  • Helpful? 0
  • Only You Can Build A Robot!
Re: Cprogramming
« Reply #5 on: March 25, 2007, 02:45:08 PM »
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.


Offline roboplane2.0Topic starter

  • Jr. Member
  • **
  • Posts: 27
  • Helpful? 0
  • Henry the Robot
Re: Cprogramming
« Reply #6 on: March 25, 2007, 08:12:17 PM »
im using Arduino-0007 Alpha. Heres the link:
http://www.arduino.cc/en/Main/Software
If you're a Halo Fan, click here http://www.freewebs.com/halowireless/forum.htm.

Offline JesseWelling

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 707
  • Helpful? 0
  • Only You Can Build A Robot!
Re: Cprogramming
« Reply #7 on: March 25, 2007, 10:41:37 PM »
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.

Offline Hal9000

  • Supreme Robot
  • *****
  • Posts: 338
  • Helpful? 0
Re: Cprogramming
« Reply #8 on: March 27, 2007, 08:38:17 AM »
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!
"The truth is, you can't hide from the truth, cos the truth is all there is" - Handsome Boy Modeling School

 


Get Your Ad Here