PicBasicPro Code help!


Results 1 to 4 of 4

Threaded View

  1. #4
    Join Date
    May 2008
    Posts
    19


    Did you find this post helpful? Yes | No

    Default Finaly got it!

    Made my protoboard and finaly found the code for assinging port pins.





    DEFINE OSC 4

    TRISB = %00000000

    x var byte
    Leds var byte
    Digs var byte

    ENABLE DEBUG

    main:


    for x = 0 to 9
    leds = x
    Digs = x
    GOSUB PORTSsegments
    gosub PORTSdiggits
    Pause 500 ' Delay for .5 seconds
    leds = %0000
    Digs = %0000
    GOSUB PORTSsegments
    gosub PORTSdiggits
    Pause 500 ' Delay for .5 seconds
    next x
    Goto main ' Go back to loop and blink LED forever


    PORTSsegments:

    PortB.0 = leds.0 : PortB.1 = leds.1 : PortB.2 = leds.2 : PortB.3 = leds.3

    return

    PORTSdiggits:

    PortB.4 = Digs.0 : PortB.5 = Digs.1 : PortB.6 = Digs.2 : PortB.7 = Digs.3

    return

    DISABLE DEBUG

    End
    Attached Images Attached Images  

Similar Threads

  1. Nokia COLOR LCD PicBasicPro 2.50a example code
    By skimask in forum Code Examples
    Replies: 49
    Last Post: - 28th September 2011, 01:43
  2. Reading in Manchester code
    By brid0030 in forum Code Examples
    Replies: 0
    Last Post: - 10th March 2009, 21:55
  3. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 21:31
  4. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  5. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26

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