memory button for mikrobasic

Thread Starter

fernandohdz

Joined Jul 11, 2014
1
Hi... Im starting on mikrobasic and i made the clasic start up... blikng all the leds on the 8 b port positions ...

Now i want to make that the blinking leds make different secuences with only one button,

I already make the secuences whit equal numbers of push buttons work ( tree secuences tree buttons, four secuences four buttons etc)

Did any one can help me on this, the push button should increse a variable and to store a value in a variable for go to especific secuence...

I just cant get it

Thanks
 

djsfantasi

Joined Apr 11, 2010
9,237
If buttonpressed increment sequencenumber

If sequencenumber greater than total number of sequences set sequencenumber equal to 1

If sequencenumber = 1 do first sequence

...
 

ErnieM

Joined Apr 24, 2011
8,415
If buttonpressed increment sequencenumber

If sequencenumber greater than total number of sequences set sequencenumber equal to 1

If sequencenumber = 1 do first sequence

...
Some sort of debouncing would also be necessary, or sequences may (will) skip over things sorta randomly.

That may be as simple as after the increment routine inserting a short (25-50 mS) delay, then holding till the button is released.
 

djsfantasi

Joined Apr 11, 2010
9,237
Some sort of debouncing would also be necessary, or sequences may (will) skip over things sorta randomly.

That may be as simple as after the increment routine inserting a short (25-50 mS) delay, then holding till the button is released.
I agree, Ernie. Just was presenting some basic logic to get the OP thinking in that direction! Excellent observation.
 
Top