blinking LED


Closed Thread
Results 1 to 15 of 15

Thread: blinking LED

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    I know, wrong chip and wrong pins... it is what I have on the bench...
    Code:
    '18F6680'07/14/09'BLINKY
       
        DEFINE OSC 20
        @ __CONFIG    _CONFIG1H, _OSC_HS_1H
        @ __CONFIG    _CONFIG2H, _WDT_ON_2H & _WDTPS_128_2H
        @ __CONFIG    _CONFIG4L, _LVP_OFF_4L
        CNT VAR BYTE
        FIRST6:HIGH PORTB.2 'SLOW
        FOR CNT = 1 TO 60:TOGGLE PORTG.4:PAUSE 100
        NEXT CNT:LOW PORTB.2:PAUSE 500:GOTO SECOND6
        
        SECOND6:HIGH PORTB.2   'FAST BLINK--REALLY FAST
        PWM PORTG.4,5,6000
        LOW PORTB.2:PAUSE 500:GOTO [color=#0000FF][b]FIRST6
    Last edited by mackrackit; - 8th April 2011 at 07:11. Reason: HTML to BB
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    Code:
    PortA = 0
    TrisA = 0
    
    Seconds var Byte
    
    LED_1      var PortA.0
    LED_2      var PortA.1
    
    Loop:
    'Your gosub comand goes here
    Goto Loop
    
    
    Blink:
    High Led_1
    Seconds = 0
    While Seconds <>5
    High Led_2
    pause 500
    Low Led_2
    pause 500
    Seconds = Seconds + 1
    wend
    Low Led_1
    Return
    
    End
    Here my contribution.

    Al.
    All progress began with an idea

Similar Threads

  1. Simple Blinking LED - WTF!!
    By johnnylynx in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 1st February 2010, 07:19
  2. Blinking an led problem on P16F84
    By aimenbukharie in forum General
    Replies: 1
    Last Post: - 20th March 2009, 06:00
  3. new and need help
    By smeghead in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 3rd November 2008, 21:19
  4. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 03:30
  5. simple LED Blinking project
    By koossa in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 11th December 2004, 02:25

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