Subject:
|
Re: servo program
|
Newsgroups:
|
lugnet.robotics.handyboard
|
Date:
|
Mon, 29 Nov 1999 19:06:10 GMT
|
Original-From:
|
bart_schrijver@agilent+saynotospam+.com
|
Viewed:
|
995 times
|
| |
| |
Dear ?:
First off, your program contains an infinite loop; statement
return(0); will never be reached. Also you told it that main does
not return a value, yet you used e return in the end. This will
generate a compiler error for sure.
I belief the IC parser expects main to be defined as follows:
int main()
{
/* code here */
}
Second: You only need to execute the initialization statement
init_expbd_servos(1); ones.
Third: Your statements need to be terminated with a ; in order for
the parser to recognize them as two individual statements.
Fourth: I am not sure if setting the variable servo0 to 1000 is the
correct way of controlling servo #0. But it might be.
Rewrite your program as follows:
int main()
{
init_expbd_servos(1);
servo0 = 1000;
return(0);
}
Bart Schrijver.
______________________________ Reply Separator _________________________________
Subject: servo program
Author: Non-HP-dab8rs-85 (dab8rs_85@yahoo.com) at HP-PaloAlto,mimegw2
Date: 11/29/99 9:03 AM
Can anyone please write me a brief servo motor program
that will control two servos from the expansion board?
This the one I had to control one, but did not work:
void main(void)
{
while(1)
{
init_expbd_servos(1)
servo0 = 1000
}
return(0);
}
__________________________________________________
Do You Yahoo!?
Thousands of Stores. Millions of Products. All in one place.
Yahoo! Shopping: http://shopping.yahoo.com
|
|
Message is in Reply To:
| | servo program
|
| Can anyone please write me a brief servo motor program that will control two servos from the expansion board? This the one I had to control one, but did not work: void main(void) { while(1) { init_expbd_servos(1) servo0 = 1000 } return(0); } (...) (25 years ago, 29-Nov-99, to lugnet.robotics.handyboard)
|
3 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|