need help with my project
Athurkidd
Posts: 3
Hi everybody, as you can see this is the first time I post in this forum and its a shame that my first post is a help request :S. Well this is what happened my dad buy this new parallax basic stamp and he asked me to help him in his project. He wants to make a ozone machine that can vacuum the air from a container and then fill it with ozone, the machine need have the option to program the time and vacuum and filling, and also that that routine can repeat and you can program the many time it will repeat, also see the programmed times and the time that it accumulate from the routine. So I finally manage to comply with this requisite and finish the machine but this happened for some reason that still confuse me the machine doesn’t stop vacuum when it get to the programmed time, so I tried everything to fix this, the only thing that I see that really have effect is change the variable of the programmed time to a number and it seems to stop, but the objective is that the machine stop in a programmed time and not in a number that you need to change from the basic stamp program. So what do you think can you help me?
txt
7K
Comments
The vacuum timer is a variable in code, and you want to make it modifiable from outside the code. Correct?
You have several options to fix this. You can add a section where the user enters a number (two buttons [noparse][[/noparse]increment and decrement] and an LCD would work) that is an approximate time count: just use that value that the user enters into some sort of loop.
You can also use a timer chip for exact times, but that will complicate your project some. =Can you point out the specific line to look at? (PS: you can post files at .BS2 so that they open in the editor by default)
Welcome to the forums!
Well actually I theres already a section to modificate the vacuum time, its in the .txt that I attached in this post and I also put a timer on it. But the problem is that the machine doesnt stop in the progammed time and it seems that it also doesnt acummulate the time . I checked the progam but I cant find the problem, this really put me really confuse. So do you have any idea that can the problem be?
Anyway, take a look at line ~250 (or so) There are two for loops, yet all that happens is that they set the increment variables equal to the end variables: aka, they don't really do anything.
I'm afraid I can't help much more with the way the code is at the moment. It will help if you format it a little better. Use these general rules to format code (by convention)
1. Avoid the use of GOTOs, and instead replace with GOSUBs
2. Place all code into a method (aka Start: or Begin_Vac[noparse]:)[/noparse] to help organize
3. Have comments that tell what each method does (or make it self documenting)
4. For multilingual code, some comments in English (translations of names) would be helpful.
Often times, just by making the code easier to read you will be able to fix problems without even noticing it...
Post Edited By Moderator (Chris Savage (Parallax)) : 11/24/2008 6:06:23 AM GMT