Nothing about floating point numbers. My version of pic basic is from when I purchased it in 2002 to make a specialized timer for a friend. I have not used it since if that helps. The manual is quite "thin". What I am truing to do is randomly turn on one of five LEDs tied to portb. I will then test a related porta input tied to a sensor to see when it goes hi or low.....to then generate another random number between 1and 5 to start the process over.
Here is the actual application, it is for a buddy of mine that has kids in scouting. I0 have a set of steel plates set out at 25 feet each steel plate has an LED mounted below it and a vibtration sensor attahed to it. each scout is given a CO2 pellet pistol loaded with 10 pellets. as each LED lights for a cetain number of seconds - usually 5, the scout needs to shoot the plate, he gets two shots at each plate. If he hits the plate it registers the hit and moves on to the next randomly selected target. At the end of the competition, the elapsed time is taken and the total number of left over pellets multiplied by a constant of usually 5 seconds, this product is then subtracted from the time. This process rewards both speed and accuracy. It is a lot of fun and I am trying to automate the process to make it more challenging. So I need a way to randomly light one of 5 target indiactors. which ever one is lit will then have its vibration sensor monitored for pellet hits.
Once hit, the led turns off and another one is lit, maybe even the same one relights. The shooter will not be able to guess as it is random..... It should be a hoot to watch them sweat.
Sorry to be so long winded
Bookmarks