Blink without the pause command


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default

    I'm using a pic 12F683 (internal oscillator) to turn on/off some lights on my R/C car...

    I'm reading the output from the receiver with pulsin and then I can turn on/off the lights...

    I'm using the pwm output to control the stop lights... Normally, they are 50% lit and when I hit the brakes they go 100% brightness...

    Also, I want to blink two yellow LEDs as turn lights, but I cannot wait while the LEDs are blinking because I need to know if something else happens, like hitting the brakes....

    So, that's why I wanted to know how to blink the LEDs without the pause command...

    I think I could do something with the "ifs", but as you said Bruce, will have to recalibrate the code...

    Thanks for your answers!

    Daniel.

  2. #2
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    I would go with Darrel Taylors' instant interrupts with timer1. Disable interrupts before using
    PULSIN. Then re-enable them after PULSIN. A few mS either way shouldn't be a big deal for
    a heart-beat type LED on/off.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  3. #3
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Lightbulb

    Hi, Daniel

    the easy way with R/C signals ...

    the servo signal is THE "missing timer" ... say the 1.5 ms is @ 40 Hz ( example )

    if you want to blink @ 2Hz ...

    just count the incoming 1.5 ms pulses and TOGGLE the led output for COUNT // 10 = 1,or 2 ... but not 0

    takes very little CPU time.

    hé,hé ...

    Alain
    Last edited by Acetronics2; - 17th August 2007 at 07:53.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

Similar Threads

  1. Delayed output 10 secs
    By lilimike in forum mel PIC BASIC Pro
    Replies: 37
    Last Post: - 14th October 2011, 06:28
  2. Old and beyond help ?
    By DavidFMarks in forum mel PIC BASIC Pro
    Replies: 46
    Last Post: - 11th December 2008, 15:23
  3. Replies: 11
    Last Post: - 12th July 2008, 02:36
  4. Fade out LEDs question
    By Sam in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 22nd June 2008, 10:50
  5. Help Quick Need to make code smaller
    By Programmednew in forum mel PIC BASIC Pro
    Replies: 41
    Last Post: - 25th January 2005, 03:46

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