Search Results - MEL PICBASIC Forum


Search:

Type: Posts; User: HenrikOlsson; Keyword(s):

Search: Search took 0.01 seconds.

  1. Replies
    71
    Views
    32,938

    Re: Beginner in need of help !!

    Like Tabsoft wrote, you generally want your DEFINEs at the top of the program but it's for readabillity. In reallity it makes no difference because they are not runtime commands.

    Another little...
  2. Replies
    71
    Views
    32,938

    Re: Beginner in need of help !!

    You can use the ADC to sample the voltage but the PIC needs to be awake for the ADC to operate and, again, the ADC doesn't run continously and can not automatically generate an interrupt when a given...
  3. Replies
    71
    Views
    32,938

    Re: Beginner in need of help !!

    Hi Rob,
    The IOC trips the interrupt on any change of the state on a digital pin. An interrupt will trip when the pin goes low and again when the pin goes high - provided you read the state of the...
  4. Replies
    71
    Views
    32,938

    Re: Beginner in need of help !!

    Hi,
    You're quite right, it's because you're using the IOC (Interrupt On Change), it'll trip the interrupt both when you push the button and when you release the button. (As well as on all the edges...
  5. Replies
    71
    Views
    32,938

    Re: Beginner in need of help !!

    Hi,
    No debounce may very well be part of the problem but in THIS case I think the contact bounce is what actually makes it sort of "work".
    The real issue, I believe, is that your "loops" looks for...
  6. Replies
    71
    Views
    32,938

    Re: Beginner in need of help !!

    Hi,
    Another aproach is to use the interrupt mechanism as a way to "latch" the buttonpress but then not actually enable the interrupt itself but instead poll the interrupt flag to determine if the...
  7. Replies
    71
    Views
    32,938

    Re: Beginner in need of help !!

    Hi Rob,

    Even though that would work for this particular application that's generally not what you want to do (ie stay in the interrupt routine). Instead you do as I showed earlier, use a...
  8. Replies
    71
    Views
    32,938

    Re: Beginner in need of help !!

    Hi Rob,
    There are several ways - as is the case most of the time.
    Interrupts are probably the way to go but there may be other ways.

    Do you have a particular chip in mind, is it still the...
  9. Replies
    71
    Views
    32,938

    Re: Beginner in need of help !!

    Hi,
    MCLR is disabled by clearing the correct "fuse" in the CONFIG word. With PBP3 you set the CONFIG word(s) with the #CONFIG/#ENDCONFIG compiler directives (more on that in the manual). Your PBP3...
  10. Replies
    71
    Views
    32,938

    Re: Beginner in need of help !!

    Hi Rob,
    If you want the button to enable/disable the blining LED then you can't toggle the LED itself in the interrupt and then just continue to blink it in the main program loop. What you need is...
  11. Replies
    71
    Views
    32,938

    Re: Beginner in need of help !!

    Hi,

    > what if I wanted to run a different command to just turning on the LED
    Don't understand this one, sorry...

    > what about if I wanted to start the LED flashing upon button tap?
    Well, yes....
  12. Replies
    71
    Views
    32,938

    Re: Beginner in need of help !!

    Hi Rob,
    Welcome to the forum! As you can imaging there are several ways to do this (and most other things). Amoque shows you one, here's another (which also tries to take care of the debounce):
    ...
Results 1 to 12 of 12