Kenneth Lerman wrote:
 > Stuart wrote:
 >> This is our thoughts on latch component. Please critique it and let
 >> me know what changes should be made.
 >
> I suspect that one of the HAL gurus would spend less time knocking
 > one of these out than he would spend reading a
> series of posts about it.
> 
> Ken

Ken is right.  I wrote "toggle" and committed it to HEAD just now.
Took about 30 minutes, including testing (and I spent some of that
chatting with cradek).  I built in a debounce function, to save
some HAL wiring.  You can set the debounce delay from 1 to 10000
thread periods (1mS to 10 seconds with EMC's normal 1mS servo thread,
probably 10-20mS is a good choice for typical pushbuttons).

Since it is not a bug fix, it won't be going into 2.1.x, but if you
want to use it, the source is at
http://cvs.linuxcnc.org/cvs/emc2/src/hal/components/toggle.comp?rev=1.1

It _does_ use comp.  I can't imagine NOT using comp for a simple 
component.  Some very complex ones might be easier to write in plain
C, but for simple ones comp is a no-brainer.  Without comp it would
probably have taken twice as long to write.

Enjoy!

John Kasunich


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to