-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!
Ok, Lets establish some basics first.
In your first post, you have a program that scrolls numbers across the screen at a rate of 1 sec per number. correct?
You are reading the numbers from an array, correct?
So if you take out the pause, it will just instantly display the whole array? If yes, this is your LCD update. call this every time you need to change the display.
reasons to update or change:
1. time to scroll
2. aim button pressed so you need to change the aim number
3. fire button pressed AND a hit is made
Now you can forget about the LCD. when you update it, send all 32 characters to it (unless random access is available, but this will take more code and understanding). The game portion of the program will minipulate the array so everytime in update is done, the numbers will be where they should be. Because they will be in the same position as they are in the array.
If none of this makes sense, please tell me where you are lost. This applies to all of my above posts.![]()
-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!
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!
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.
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!
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.
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!
Bookmarks