Shop OBEX P1 Docs P2 Docs Learn Events
interrupts — Parallax Forums

interrupts

goldfingerfifgoldfingerfif Posts: 18
edited 2006-08-23 19:54 in General Discussion
Are there any type of interupts with the Basic Stamp? I want it to monitor voltage but if you press a button for it to change what it limits it at but i cannot figure out how to do the interrupt to raise or lower it. I could do a loop that watches it but then it must constantly check the button status which would significantly slow the chip down.

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-08-23 19:37
    goldfingerfif-

    Looping as you suggested is the best way to do it, unless you are using a BS-2P? then look at the POLL command.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
  • metron9metron9 Posts: 1,100
    edited 2006-08-23 19:54
    Somebody said...
    it must constantly check the button status which would significantly slow the chip down

    That depends on how many times the polling routine needs to execute. A button press is pretty slow, so testing could be 10 times per second, your main code would have to be written on a way that uses flags and short routines that last a maximum of less than 1/10 second though. If it is a single button press you could use a flip flop to store the on off condition and clear it after you read it. If it's a hold button to increase voltage then it really dosent matter if its even 1 second delay before your program finds it is held down and can deal with it when it finds it.

    So it really depends on how much you need to do and of course how you program it to do it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think outside the BOX!
Sign In or Register to comment.