Need 4 modes with just 3 switches - need all modes to be selectable QUICKLY!


Results 1 to 40 of 68

Threaded View

  1. #17
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default

    so wouldn't SOMETHING as noobesque (as befits me) like this suffice...

    Code:
    Switch_Interrupt:
    
    If sw1 = 0 then 
    mode = 1
    HIGH LED1  'green LED
    LOW LED2   ' red LED
    endif
    
    If sw2 = 0 then 
    mode = 2
    HIGH LED1  'green LED
    HIGH LED2   ' red LED
    endif
    
    If sw3 = 0 then 
    mode = 3
    LOW  LED1  'green LED
    HIGH LED2   ' red LED
    endif
    
    @ INT_RETURN

    (Yielding either a green LED, amber-esque led, red led)

    ok, it needs padding out....just wanted to get the main cut & thrust across.... the LED would change colour pretty darned quick, thereby giving the user the feeling of 'rapido'.

    Yes, sure there'll be an interupt generated when the finger is removed from the switch, but since none of the conditions in the Switch_interrupt subroutine would be met (since the pins would be high when the second interrupt happens) nothing will happen? - a few clock cycles wasted - but hey, there's heaps more where they came from?

    or would the quick succession interrupt from the finger being removed from the switch cause probs?
    Last edited by HankMcSpank; - 7th August 2010 at 21:32.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts