Confused.... Help Please!


Closed Thread
Results 1 to 32 of 32

Hybrid View

  1. #1
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default

    oh yea, one more thing. Ask dad if there is any hardware de-bouncing on the switches. If not, they will be something you will need to deal with in software.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  2. #2
    Join Date
    Sep 2010
    Posts
    17


    Did you find this post helpful? Yes | No

    Default

    Ok i can rebuild the array as you say and debouncing i have done in the software, the problem i have is that the scrolling text code only is a for next loop which is running cell by cell on the lcd not updating the whole thing.

    I could update the whole thing by starting with 14 blank array spaces at start rather than filling it all, and adapt the array 1 by 1 that way until 0-13 are filled with the numbers behind them (coming from the right) that way i can just update the lcd everytime with NOS[1-14] which will be the only onscreen values since 1-2 are taken by the number followed by a colon.

  3. #3
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default

    I think you are following me now. the LCD is really static, not scrolling, the array is what scrolls. Yes, as I posted in the beginning, start with the array filled with blank spaces or " " if you will.

    try it out at first with just adding a number to the array every second, then updating the LCD. it should have the scroll effect you are looking for. The number you add to the array should be a random number, I don't recall if PBP has a random number generator, but you could just increment the number for now.

    Once you have that worked out, move on to making the aim change as you press the aim button. from there its all just logic and playing with the array.
    Last edited by cncmachineguy; - 28th September 2010 at 16:20.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  4. #4
    Join Date
    Sep 2010
    Posts
    17


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by cncmachineguy View Post
    I think you are following me now. the LCD is really static, not scrolling, the array is what scrolls. Yes, as I posted in the beginning, start with the array filled with blank spaces or " " if you will.

    try it out at first with just adding a number to the array every second, then updating the LCD. it should have the scroll effect you are looking for. The number you add to the array should be a random number, I don't recall if PBP has a random number generator, but you could just increment the number for now.

    Once you have that worked out, move on to making the aim change as you press the aim button. from there its all just logic and playing with the array.
    Indeed, I continue to underestimate the speed of 20Mhz.

    I will be able to use the array manipulation as you say in a for next loop easily

    I think i will first start with the shooting the far left number only for now and then move onto numbers anywhere later on since that will require that I scn the array and adjust it many times.

    I do have the number changing figured out and also the "n" character and I can also shoot thats no problem ... I have the debounce and all that sorted it was just the scrolling i wasnt sure about since I was thinking of another approach.

    Unfortunately since pbp does not support that approach directly its alot easier to just as you say manipulate the array, I will get on with programming it tomorrow.

  5. #5
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default

    That's great! Will you be sharing? Just curious cuz I like this application. As someone who played this when it was new, it just seems cool to have.

    Are you willing to share your LCD hookup? And your actual part number for it? I would like to play with LCD's, but never seem to find time to hunt one down. No worries if you don't want to, you ARE NOT obligated to in any way.

    I have had fun helping with this, you are required to share a pic or video though.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  6. #6
    Join Date
    Sep 2010
    Posts
    17


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by cncmachineguy View Post
    That's great! Will you be sharing? Just curious cuz I like this application. As someone who played this when it was new, it just seems cool to have.

    Are you willing to share your LCD hookup? And your actual part number for it? I would like to play with LCD's, but never seem to find time to hunt one down. No worries if you don't want to, you ARE NOT obligated to in any way.

    I have had fun helping with this, you are required to share a pic or video though.
    Of course!

    I will be happy to share any information with you regarding the board and my dad can provide you with the part numbers and all.

    I have just gone back over the notes for this program before I began writing it and I have noticed that the array is made up of "Bytes" meaning I cannot enter a space or " " since it sees it as a string or char and converts it to the decimal value any ideas?

    I suppose I could just get the decimal value and check to see if the vallue in the array is equal to that value and just override it for the lcd printing a space, it is just awquard to do it that way and means more code hehe
    Last edited by UKIkarus; - 29th September 2010 at 12:40.

  7. #7
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by UKIkarus View Post
    I have just gone back over the notes for this program before I began writing it and I have noticed that the array is made up of "Bytes" meaning I cannot enter a space or " " since it sees it as a string or char and converts it to the decimal value any ideas?
    Always keep this in mind, everything is made up of bytes, strings and things are just converted for our convinence to read. So you are correct, the " " IS repersented by some number, that is the number to check against.

    But I would have thought using PBP, you could have a statement like t(2)=" ". that should be no different then t(3)="3".Of course this is different then T(3)=3 with no quotes. Am I wrong? good chance of that, but either way assuming I am not wrong, will work just fine.t(2)=" " means PBP will convert " " to some byte. then your check would be IF T(2) = " ". the key here may be in the quotes.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

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