Program of encoder counts badly

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
User avatar
Francisco Cabrera
Posts: 47
Joined: Sat Mar 19, 2016 4:56 pm
Location: Canary Island
Has thanked: 23 times
Been thanked: 7 times
Contact:

Program of encoder counts badly

Post by Francisco Cabrera »

Hello good evening, this program does not work well...And I cannot discover for that :? ,
I turn the encoder to the right, the program counts well, 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,
But if I turn the encoder to the left side, the program counts ...16,15,14,13,12,10,90,80,70,60,50,40,30,20,10,01 :shock:

Someone might help me?´,

PD:Forgive my ignorance, I am a new user.
Attachments
Flowcode1 ENCODER.fcfx
(8.94 KiB) Downloaded 278 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Program of encoder counts badly

Post by Benj »

Hello,

If you print a space or two after you print the number then this should solve the problem.

What you are doing is printing "10"

Then the next time around you print "9" however the "0" from the "10" is still there so you get "90".


Another way is to detect if the number is less than 10 and if it is then print a 0 before you print the number.

this gives you "10" and "09"

User avatar
Francisco Cabrera
Posts: 47
Joined: Sat Mar 19, 2016 4:56 pm
Location: Canary Island
Has thanked: 23 times
Been thanked: 7 times
Contact:

Re: Program of encoder counts badly

Post by Francisco Cabrera »

hello everybody, I think that it is possible to do the program of different form, I leave here this program, he is working perfectly,For if someone needs it.

PD:Thank you Benj
Attachments
Flowcode1 ENCODER.fcfx
(11.42 KiB) Downloaded 282 times
Last edited by Francisco Cabrera on Wed Jun 15, 2016 6:58 pm, edited 1 time in total.

User avatar
Francisco Cabrera
Posts: 47
Joined: Sat Mar 19, 2016 4:56 pm
Location: Canary Island
Has thanked: 23 times
Been thanked: 7 times
Contact:

Re: Program of encoder counts badly

Post by Francisco Cabrera »

I have a last question please, in flowcode it is not possible to activate interruption in RB0 and with flank of raise Or flank of descent ?
I have used interruption in (rb4, rb5, rb6, rb7) because not as doing it with interruption rb0

PD:Regards

User avatar
Francisco Cabrera
Posts: 47
Joined: Sat Mar 19, 2016 4:56 pm
Location: Canary Island
Has thanked: 23 times
Been thanked: 7 times
Contact:

Re: Program of encoder counts badly

Post by Francisco Cabrera »

After many hours of study, I have seen how to do interruption in rb0 with flank of raise and flank of descent, yes we can in flowcode, I have used it to detect the step for z of the encoder, I leave here capture of screen for if someone needs some day...

PD: I´m very grateful for your help, without her the program had never worked regards. :D
Attachments
Z.jpg
Z.jpg (86.7 KiB) Viewed 4704 times

Post Reply