Digital input to float

More
2 years 2 months ago #308345 by slowpoke
I have external push buttons for jog increment and I'm trying for example to update halui.axis.x.increment with the value 0.001
conv_bit_float seems like it should work for this?

It's not obvious how I get the float value of 0.001, assigned to the float value?
Error is postgui.hal:202: Pin '0.001' does not exist

The external button is updating net jog-inc-1 when I push the button (observed in Hal show)
Excerpt from postgui is as follows:

loadrt conv_bit_float count=1
addf conv-bit-float.0 servo-thread

net jog-inc-1 <= arduino.keypad.Jog-Inc-1
net jog-inc-1 => conv-bit-float.0.in
net jog-inc-1f  conv-bit-float.0.out 0.001

Please Log in to join the conversation.

More
2 years 2 months ago #308347 by PCW
Replied by PCW on topic Digital input to float
conv_bit_float will just turn a bit to 0.0 or 1.0

Normally  the way jog increments are selected are with a mux
component, say mux4

man mux4
 

Please Log in to join the conversation.

Time to create page: 0.070 seconds
Powered by Kunena Forum