How to use For Next Loop to run sequence light ?


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    Join Date
    Aug 2010
    Posts
    7


    Did you find this post helpful? Yes | No

    Default

    Thank you Acetronics, thanks to you, I now understand everything I need to understand for my Build from scratch Tricorder Project.

    This is the note I have compiled based on what you have explained.


    'Make them all outputs, Remember Pin 4, PortA.5 will always be Input Only
    'And Pin 3, PortA.4 needs a pull up resistor.

    'Understand that these two lines will make High, all Pins
    'meaning the LEDs will ALL light up.
    TRISA = 0 'Set all PortA Pins as Outputs
    TRISB = 0 'Set all PortB Pins as Outputs

    'Make All PortA and PortB's lights Down, the "&" here means "Clear".
    PORTA = PORTA & %00000000
    PORTB = PORTB & %00000000

    Make PortA and PortB's .0 lights up, the "|" here means "Set".
    PORTA = PORTA | %00000001
    PORTB = PORTB | %00000001

    [This is a powerful concept Bracer, with this you no longer need to do the:
    High PortB.0 crap.
    A single line to clear all and a single line to set all, the ONLY THING YOU MUST
    take note is to line up your LEDs from PortB.7 to PortB.0 in your device instead
    of 0 to 7, this is because as you can see, this one line code is backward, setting
    the last digit to 1 actually set Port*.0 and %10000000 sets Port*.7 to high.
    So to make it easier for you to visualize your
    lights animations [I'm repeating myself here], set your LEDs on your device from
    Port*.7 [Or whatever is the highest port number you use for output] to lowest.
    ]

    [This also means that setting:
    PORTA = PORTA | %00100000
    is useless because PortA.5 [Pin 4] can only be use for input detection,
    setting it to high means nothing.
    ]

    You can see my Tricorder project here:
    http://www.bracercom.com/wip/content...der/index.html

    It's still very much in WIP but I will be sure to give you credit when I've come to the electronic part of the Tricorder.
    Last edited by Bracer; - 31st August 2010 at 09:43.

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Bracer View Post
    You can see my Tricorder project here:
    http://www.bracercom.com/wip/content...der/index.html

    It's still very much in WIP but I will be sure to give you credit when I've come to the electronic part of the Tricorder.
    Hi, Bracer

    May be ... you should have a look to NOKIA graphic screens ...costless and ... marvellous color effects ...

    Alain
    ************************************************** ***********************
    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 " !!!
    *****************************************

  3. #3
    Join Date
    Aug 2010
    Posts
    7


    Did you find this post helpful? Yes | No

    Default

    NOKIA graphic screens with 16F628a ?

    Wow...I have like no idea how...

    I wouldn't even know how to begin with that.
    Last edited by Bracer; - 3rd September 2010 at 00:13.

  4. #4
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Try this Google link to search the forum, I think it has been done in here already.
    http://www.google.com/custom?hl=en&c...ch&sitesearch=
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

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