Subject:
|
Re: Runtime Error 3
|
Newsgroups:
|
lugnet.robotics.handyboard
|
Date:
|
Sat, 22 Mar 1997 03:44:02 GMT
|
Original-From:
|
EDWIN SALGADO <inca@&IHateSpam&sfsu.edu>
|
Viewed:
|
2467 times
|
| |
 | |
Hi Peter,
Well let me give it a shot, without actually downloading it to
the Handy Board. It should go something like this:
/* GLOBALS */
int num_sensors = /*put the number of analog sensor inputs you want*/
void main()
{
int sensors[num_sensors];
int counter;
while(1)
{
counter = 0;
while (counter < num_sensors)
{
sensors[counter] = analog(counter);
printf("%d ",sensors[counter]);
counter++;
}
printf("\n");
sleep(900.0);
}
}
Always give descriptive variable names. It makes the code more readable.
Hope this helps. Remember I didn't try it out on the board, but it should
work. The printf(...) statements are so you can see the value on the
LCD.
Edwin-
On Fri, 21 Mar 1997, Peter Eacmen wrote:
> I'm kind of new to IC and I don't know how to deal with all the errors
> yet. I wrote a simple code to record sensor inputs every 15 minutes.
> This is the code I wrote:
> void main()
> {
> while(1)
> {
> int x[];
> int s=analog(0);
> int f=0;
> s=x[f];
> sleep(900.0);
> f+1;
> }
> }
> When I download it the LCD says: Runtime ERR 3. How do I solve this?
>
> Peter Eacmen
> --
> Peter Eacmen
> Boston Latin School
> E-Mail:Eacmen@postoffice.worldnet.att.net
> Home Page: http://www.geocities.com/Area51/Vault/2766/
>
|
|
Message is in Reply To:
 | | Runtime Error 3
|
| I'm kind of new to IC and I don't know how to deal with all the errors yet. I wrote a simple code to record sensor inputs every 15 minutes. This is the code I wrote: void main() { while(1) { int x[]; int s=analog(0); int f=0; s=x[f]; sleep(900.0); (...) (28 years ago, 21-Mar-97, to lugnet.robotics.handyboard)
|
3 Messages in This Thread:   
  
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|