memory button for mikrobasic

Discussion in 'Programmer's Corner' started by fernandohdz, Jul 11, 2014.

  1. fernandohdz

    Thread Starter New Member

    Jul 11, 2014
    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

  2. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    If buttonpressed increment sequencenumber

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

    If sequencenumber = 1 do first sequence

  3. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    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.
  4. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    I agree, Ernie. Just was presenting some basic logic to get the OP thinking in that direction! Excellent observation.