What the heck am I doing wrong?


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Jan 2012
    Location
    Grid EN19MV
    Posts
    159


    Did you find this post helpful? Yes | No

    Default Re: What the heck am I doing wrong?

    I think this would work too - thanks! It amazes me how many ways there are to do the same thing.

  2. #2
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,159


    Did you find this post helpful? Yes | No

    Default Re: What the heck am I doing wrong?

    Wait, there's more, the brainiacs will post assembler solutions now.

    Robert

  3. #3
    Join Date
    Jan 2012
    Location
    Grid EN19MV
    Posts
    159


    Did you find this post helpful? Yes | No

    Default Re: What the heck am I doing wrong?

    Quote Originally Posted by Demon View Post
    Wait, there's more, the brainiacs will post assembler solutions now.

    Robert
    Actually, before I saw Henrik's method, I came up with ANOTHER solution that worked too. I used byte-sized arrays. It worked great, only it used 160 bytes of 367 bytes of total RAM available. Using arrays the way Henrik showed me (same thing, only on the bit level) it's only a few bytes.

    Before I came up with the byte array solution, I was toying with an assembler subroutine that used BTFSC f,b (if bit 'b' in register 'f' is a one, the next instruction is executed, otherwise skipped).

    So I would have tested the bit, then next instruction would branch to a routine that set the light on, the instruction after would set the light off.

    I just KNEW that PBP would be able to do it though.

    The best part? The dang program worked first try! Only a couple of syntax errors to clear up, but IT WORKED! Tested everything on a breadboard, now all I have to do is build it in a box and make it look pretty......

    Thanks for all the help!

    Andy

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