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 / 186
185  |  187
Subject: 
Re: Motor control
Newsgroups: 
lugnet.robotics.handyboard
Date: 
Mon, 18 Mar 1996 19:05:12 GMT
Original-From: 
Tom Cicatelli <cica@tiac.ANTISPAMnet>
Viewed: 
2014 times
  
Tom G. Brusehaver/Consultant Euler Solutions wrote:

While we're on the topic, I am considering changing the speed
argument, because in actuality there are only eight discrete power
levels from off to full on, so having the speed argument range from 0
to 8 might make more sense than 0 to 100.

<snip>

Could it be handled well by using #defines (constants), or other
functions?

#define MOTOR_STOP         0
#define MOTOR_REALLY_SLOW 12
#define MOTOR_KINDA_SLOW  25
#define MOTOR_MEDIUM_SLOW 37
#define MOTOR_MEDIUM      50
#define MOTOR_MEDIUM_FAST 62
#define MOTOR_PRETTY_FAST 75
#define MOTOR_REALLY_FAST 87
#define MOTOR_FULL       100


It would make more sense to just use motor(1,speed*14)

This would give you the following:

Value --> Speed
0     -->   0
1     -->  14
2     -->  28
3     -->  42
4     -->  56
5     -->  70
6     -->  84
7     -->  98

I wouldn't bother rewriting the routine.

Tom
--
____________________________________________________________________
Tom Cicatelli                                          cica@tiac.net
Melrose, Massachusetts
____________________________________________________________________



Message is in Reply To:
  Re: Motor control
 
(...) Depends on how far you wish IC to go. Someday there could be another controller that allows 100 disrete levels. On the other hand that could be handled well by allowing the value to go to 100, and the code written to go to 8 would be kinda (...) (29 years ago, 18-Mar-96, to lugnet.robotics.handyboard)

4 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