To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.handyboardOpen lugnet.robotics.handyboard in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / Handy Board / 4095
4094  |  4096
Subject: 
check_sensors.c
Newsgroups: 
lugnet.robotics.handyboard
Date: 
Fri, 3 Jul 1998 16:37:20 GMT
Original-From: 
Terry Garthright <669@WORLDNET.ATT.saynotospamNET>
Viewed: 
1237 times
  
Hello All,

I would like to write code for the handyboard to constantly

monitor inputs.

I copied this this code from the mail arcives 3-22-97, whats wrong??

                                Thanks in Advance

                                Terry Gathright

                                669@worldnet.att.net



/* GLOBALS*/

int num_sensors =6 /* put the number of analog sensor inputs you want*/

void main()

{

int sensors[num_sensors];

int counter;

while

{

counter = 0;

while (counter < num_sensors)

{

sensors[counter] = analog(counter);

printf("%d",sensors [counter] );

counter++;

}

printf("/n");

sleep(.5);

}

}



--
MIME ATTACHMENTS DISCARDED:

1.  Content-Type: text/html;
    charset="iso-8859-1"
    Content-Transfer-Encoding: quoted-printable
    Content-Length: 1694



Message has 2 Replies:
  Re: check_sensors.c
 
(...) All C declarations must be terminated with a semicolon. Try : int num_sensors = 6; ^ (...) is this legal syntax for "while"? Try: while (1) (...) If you just wanted to print out the analog sensor value, do you really want to dump them into an (...) (26 years ago, 4-Jul-98, to lugnet.robotics.handyboard)
  RE: check_sensors.c
 
Terry, It seems that alot of the problems with this piece of code are syntax errors, you could correct alot of these by looking up the secific syntax in the HB manual and there may or may not be a few things that I would have done differently (...) (26 years ago, 7-Jul-98, to lugnet.robotics.handyboard)

3 Messages in This Thread:


Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR