Subject:
|
Re: motor routines in lib_hb.c
|
Newsgroups:
|
lugnet.robotics.handyboard
|
Date:
|
Mon, 14 Apr 1997 23:52:51 GMT
|
Original-From:
|
Dan Horner <dan.horner@utoronto.#saynotospam#ca>
|
Viewed:
|
1397 times
|
| |
| |
At 19:26 4/14/97, Rajesh Gottlieb wrote:
> Does anyone know why these eight speeds were chosen in lib_hb.c for the
> motors and what would happen if the code were re-written to allow any
> speed between 0 and 255?
>
> int _speed_table[]= {
> 0b00000000, /* speed 0 */
> 0b00010001,
> 0b01001001,
> 0b01010101,
> 0b01010111,
> 0b01110111,
> 0b01111111,
> 0b11111111 /* speed 7 */
> };
These 8 bit masks are the most symmetrical way to to organize speeds of 0
through 7/7. You could rewrite the code to accept a byte and use that as
the mask, but unless you think it would save space, it's a waste of time.
The miniboard routines I've been using can go from 0 through 16, and the
difference between adjacent speeds is not noticable on any motors I've
tried.
Hope it helps, Dan.
__
Or is it true that a nation cannot cross a desert of organized forgetting?
|
|
1 Message in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|