henoSH / myrobotlab

Automatically exported from code.google.com/p/myrobotlab
0 stars 0 forks source link

Refactor Motor Service #27

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Make it non-Arduino specific - power/direction is -1.0 <-> 0 <-> 1.0
Create interface for addListener(Encoder interface)
So that something which can count (relative encoder, absolute encoder,  timer, 
etc) can control the motors functions - stop specifically..

Motor m = new Motor("mymotor");
m.addEncoder(new Timer("t1));
m.moveTo(pwr, position);  // where position is in this case some time quantity. 
 had it been an actual encoder the position woud be some relative increment or 
absolute position

adding an Encoder will setup the message routes and event hanldlers

Original issue reported on code.google.com by supert...@gmail.com on 7 Nov 2011 at 8:33

GoogleCodeExporter commented 8 years ago
Should the moveTo() method's "position" parameter be something that is an 
interface? Would that help with using the addEncoder() with the appropriate 
stepping type?

Original comment by SwedaKon...@gmail.com on 27 Aug 2012 at 5:27