blinking LED


Closed Thread
Results 1 to 15 of 15

Thread: blinking LED

Hybrid View

  1. #1
    Join Date
    Jul 2009
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Joe S. View Post
    untested . . .
    Code:
    PortA = %00000000
    TrisA = %00000000
    i var byte
    Start:
    PortA.1 = 1
    while PortA.1 = 1
    For i = 0 to 5
    portA.0 = 1
    pause 500
    PortA.0 = 0
    pause 500
    next i
    portA.1 = 0
    wend
    
    end

    Hi..
    Thanks for all
    I test your code and its working fine but because I am new with picbasic what dose this meen
    PortA = %00000000
    TrisA = %00000000
    When I remove this tow lines the code not working,
    Best regard

  2. #2
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    971


    Did you find this post helpful? Yes | No

    Default

    PORTA = %00000000 read this as PORTA gets bits 00000000
    This means, write 0 to each bit position of PORTA. Each 0 represents the bits in PORTA from bit 7 to bit 0. You could also write it as
    PORTA = $00 read this as PortA gets Hex 0

    TRISA = %00000000
    This is the tristate register which tells your PIC to allow the values of PORTA to 'drive' the external world circuits. Same as above for the bit position part. If you set any 1 position to 1, that position will only be able to read (INPUT) from the external circuit.

    Clear now? Don't hesitate to ask. See how many responses you got.

  3. #3
    Join Date
    Sep 2003
    Location
    INDIA
    Posts
    161


    Did you find this post helpful? Yes | No

    Default A slight modification to Sayzer's code

    I am looking for a way to change the rate of blink (Blinking rate) using Interrupt. I would read a POT using ADC and then change the blink rate, Any idea how I could impliment it in Sayzer's code.

    Thanks.

    p.s. maybe using TMR0

  4. #4
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    A question for you first... why do you specify using INTERRUPT?

  5. #5
    Join Date
    Sep 2003
    Location
    INDIA
    Posts
    161


    Did you find this post helpful? Yes | No

    Default

    Cause, I want to use it in a code where I am doing some other things like reading ADC channel , and monitoring inputs , while the led is blinking.

    Thanks

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


    Did you find this post helpful? Yes | No

    Default

    You may want to look at this. Post #2 might be of interest.
    http://www.picbasic.co.uk/forum/showthread.php?t=3251
    Dave
    Always wear safety glasses while programming.

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