Subject:
|
Re: check_sensors.c
|
Newsgroups:
|
lugnet.robotics.handyboard
|
Date:
|
Sat, 4 Jul 1998 13:15:59 GMT
|
Original-From:
|
David Kott <dakott@alpha.delta(nomorespam).edu>
|
Viewed:
|
1162 times
|
| |
| |
On Fri, 3 Jul 1998, Terry Garthright wrote:
>
> /* GLOBALS*/
>
> int num_sensors =6 /* put the number of analog sensor inputs you want*/
All C declarations must be terminated with a semicolon. Try :
int num_sensors = 6;
^
>
> void main()
>
> {
>
> int sensors[num_sensors];
>
> int counter;
>
> while
is this legal syntax for "while"? Try:
while (1)
> {
>
> counter = 0;
>
> while (counter < num_sensors)
>
> {
>
> sensors[counter] = analog(counter);
>
> printf("%d",sensors [counter] );
>
> counter++;
>
> }
>
> printf("/n");
>
> sleep(.5);
>
> }
>
> }
>
>
If you just wanted to print out the analog sensor value, do you really
want to dump them into an array?
void main() {
int iIndex;
while (1) {
for (iIndex=0; iIndex <= 6 ; iIndex++) {
printf("%d",analog(iIndex));
}
printf("\n");
msleep(500L);
}
I think my IC skills are a bit rusty; there may be errors in my
implementation.
-d
The box said "Requires Windows 95/NT or better"...
So I got Unix.
Free the Source. Free your Computer... http://www.FreeBSD.org
http://www.NetBSD.org
http://www.OpenBSD.org
|
|
Message is in Reply To:
| | check_sensors.c
|
| 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 (...) (26 years ago, 3-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
|
|
|
|