Digital input to float

  • slowpoke
  • Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
2 years 2 months ago - 2 years 2 months ago #308345 by slowpoke
Digital input to float was created 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
Last edit: 2 years 2 months ago by slowpoke.

Please Log in or Create an account 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
 
The following user(s) said Thank You: meister, slowpoke

Please Log in or Create an account to join the conversation.

Time to create page: 0.040 seconds
Powered by Kunena Forum