Page 1 of 1

Quad encoder help

Posted: Wed Jun 02, 2021 5:20 pm
by pollob00
I have viewed a example to quad encoder counting number.so i modified it to show decimal number with encoder.but problem is its show int number insted of decimal number
i have attached the project.where was the problem in code?
Quad_Encoder_Timer.fcfx
(12.67 KiB) Downloaded 112 times

Re: Quad encoder help

Posted: Wed Jun 02, 2021 8:10 pm
by medelec35
Hi, pollob00.
Instead of

Code: Select all

dis = ToString$ (rty)
Try

Code: Select all

dis = FloatToString$ (rty) 
instead
Without the preceding Float, then the float changed to an interger before being displayed on LCD.
If you are still having an issue, then precede Count:

Code: Select all

rty = Count
with the FLOAT key word:

Code: Select all

rty = FLOAT Count
If you want to display the float to 2 decimal places for example you can use

Code: Select all

dis = FloatToString$ (rty,2)

Re: Quad encoder help

Posted: Thu Jun 03, 2021 12:36 pm
by pollob00
I have done that's all.But din't worked for me.still same isssu

Re: Quad encoder help

Posted: Thu Jun 03, 2021 3:23 pm
by medelec35
Can you attached your modified flowchart and I will take a look at it, and see if I can spot the issue?