And what if I add some special character to my data array, so when reading it, I do not no longer need to store length of each string? This should allow me to skip all that ASM things.
And meanwhile, I have a little problem with usability.
I have this routine for handling two buttons connected via ADC.
Code:
do
adcin 0,cnt
if CNT<900 then'if any button pressed, increase debounce variable
dly=dly+1
pause 1
endif
if CNT<100 and DLY>100 then 'if left is still pressed
dly=0 'reset debounce counter
task1:
endif
if CNT<900 and CNT>100 and DLY>100 then 'if right is still pressed
dly=0 'reset debounce counter
task2:
endif
loop
It analyzes, whenever any button is pressed, and launches debouncer loop, to avoid accidental presses. That works fine. This code is repeated several times in sequence, according to menu items, with different task1/task2 -s inside.
But the problem is, that if user keeps pressing the "left" button, he scrolls thru the all menu items, and I want to avoid this, so when he presses the left button and keeps it pressed, He does not advance to next item, until he releases the button and presses it again. I know, this feature is a part of BUTTON statement, but due to shortage of pins, I'm using ADC input, and BUTTON statement does not works there.
any ideas?
Bookmarks