Re: bitx and ubitx encoder replacement / Software Issues (too slow)

Sascha Bohnet | DL5SMB
 

So, I played some more and found a simple solution that works for me.

As I could not figure out, why the new library was not working, i rewired the encoder to the analog inputs
and  reloaded the original code - but, based on my earlier findings, made two changes:

Within the enc_read() function, I changed both delay(1) commands to delayMicroseconds(1),
so the function looks like this.

With this change of code I seem to get my 100 pulses per rotation - though the faster I go the more pulses get swallowed.
But I think this workaround is bearable :-)

I also tried fiddling around with the millis(), exchanging them for micros(), but this was more pain than it was worth,
though maybe I just tried the wrong values (I tried 1 and 500 instead of the default 50).

Maybe this helps someone - I just wanted to document what I found for everyone else who does not have too much experience in programming.

Sascha
 

Join BITX20@groups.io to automatically receive all group messages.