1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

A quick question.

Discussion in 'Oshonsoft' started by SwingeyP, Aug 10, 2014.

  1. SwingeyP

    SwingeyP Member

    Joined:
    Apr 26, 2010
    Messages:
    292
    Likes:
    2
    Location:
    Birmingham UK
    Does this thinking make sense?

    I want to light some led's in a kind of random sequence after a set time until an interrupt occurs.
    This is my thinking does it make sense?

    on interupt switchalloff
    call waittime
    loop: call lightleds
    goto loop

    end
    ______________________
    waittime:

    wait 3 mins or so
    ________________________
    lightleds:

    run led sequence
    ________________________

    switchalloff:
    turn all outputs off
    reset interupt


    make sense? Will it work?


    Thanks in advance - Paul
     
  2. misterT

    misterT Well-Known Member Most Helpful Member

    Joined:
    Apr 19, 2010
    Messages:
    2,697
    Likes:
    368
    Location:
    Finland
    No. And Yes.
     
  3. SwingeyP

    SwingeyP Member

    Joined:
    Apr 26, 2010
    Messages:
    292
    Likes:
    2
    Location:
    Birmingham UK
    helpful :)
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,165
    Likes:
    910
    Location:
    Rochdale UK
    ONLINE

    I think it would.. I can't see why not..

    If you switch all off in one interrupt... Organize the interrupt for a 3 minute ( or so) delay so when it fires it will run the LED sequence... Then just reset and it will loop...
     
  6. SwingeyP

    SwingeyP Member

    Joined:
    Apr 26, 2010
    Messages:
    292
    Likes:
    2
    Location:
    Birmingham UK
    Thanks Ian.

    I'll have a play and see what I come up with. Sometimes it just helps to share your thoughts.

    Cheers - Paul
     
  7. misterT

    misterT Well-Known Member Most Helpful Member

    Joined:
    Apr 19, 2010
    Messages:
    2,697
    Likes:
    368
    Location:
    Finland
    Running a lightshow in 3 minute cycles is not really random.. What do you mean when you say "I want to light some led's in a kind of random sequence"?
     

Share This Page