Problem with ports help plz


Results 1 to 34 of 34

Threaded View

  1. #4
    Join Date
    May 2009
    Posts
    66


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Bill Legge View Post
    I think you have a few errors in your code:

    1. If you want to flash the LEDs on PORTB, you must make PORTB an output:

    TRISB = 0

    2. The first pattern of LEDS only has 7 bit, make it eight:

    PORTB = %01111111

    3. At the end, just befor the loop ' GOTO Main' you need another PAUSE 100 of the LEDS will change too fast to see.

    So the Main bit of your code should look like:

    DEFINE OSC 4
    TRISB = 0
    PORTB = 0

    Main:
    PORTB = %10101010
    PAUSE 100
    PORTB = %01010101
    PAUSE 100
    GOTO Main

    END
    THANK U FOR HELPING ME, IT WORKS GREAT I WAS WRITING SMALL LETTERS THATS WHY ,THIS MY CODE
    FOR LED MATRIX 5X9 AND 4017 IC IT SHOWS ": A A "
    DEFINE OSC 4
    TRISB = 0
    PORTB = 0
    J VAR PORTB.5
    Main:
    PORTB.6 = 1
    PORTB = %00100001 '
    PAUSE 1
    J =0
    PORTB = %00111010 '
    PAUSE 1
    J = 0
    PORTB = %00100001 ' LETTER A
    PAUSE 1
    J = 0
    PORTB = %00111111 'SPACE
    PAUSE 1
    J = 0
    PORTB = %00100001 '
    PAUSE 1
    J =0
    PORTB = %00111010 '
    PAUSE 1
    J = 0
    PORTB = %00100001 'LETTER A
    PAUSE 1
    J = 0
    PORTB = %00111111 ' SPACE
    PAUSE 1
    J = 0
    PORTB = %00110101 ' DOTS :
    PAUSE 1

    GOTO Main

    END

    JUST THINKING HOW I DO MY VARIABLES TO SCROLL TEXT AND SHOW MANY LETTERS ,THANK U BOTH AGAIN ,
    Last edited by Mus.me; - 26th July 2009 at 05:37.

Similar Threads

  1. sleep problem help plz >>>.
    By Mus.me in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 16th November 2009, 09:21
  2. Replies: 6
    Last Post: - 10th January 2008, 11:38
  3. ESC problem plz help
    By al000y in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 21st January 2007, 11:21
  4. Problem reading multiple ADC ports
    By jswayze in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 4th November 2004, 17:46
  5. Problem with intensity.. plz help
    By Srigopal007 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 7th October 2004, 18: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