Life Testing Unit
turkeyus
Posts: 8
I am working on a project to test life cycle of a spa jet. I wrote the code with my entry level knowledge. Unfortunately I cannot compile. I attached the code and the schematics of what I am trying to accomplish. I need a help to check my code and suggestion on my circuit board - if there is any- such as if I need to use any resistors between the Solid State relays and BS2. If any body can help me I will greatly appreciate it.
Regards,
Regards,
Comments
· So -- How about a "flow chart"?
This is what JON's Example was to your post
http://forums.parallax.com/forums/default.aspx?f=5&m=123240
This is what PJ is talking about What is RED
' {$STAMP BS2}
' {$PBASIC 2.5}
secs VAR Byte
mins VAR Byte
tmr VAR Byte
Wait_Seconds:
FOR tmr = 1 TO secs
PAUSE 1000
NEXT
RETURN
Wait_Minutes:
FOR tmr = 1 TO mins
PAUSE 60000
NEXT
RETURN
'Now your main program can call either subroutine as needed.
'Let's say you wanted to delay for one hour, five minutes, ten seconds.
'You could now DO it like this:
mins = 65
GOSUB Wait_Minutes
secs = 10
GOSUB Wait_Seconds
Now i am at work and can not tell you if this works because i don not have my BS2 with
today
One thing i would ADD to what PJ Said is
You Need get the TIMER part of your CODE to WORK FRIST which is what i have here
While i can not try this CODE to see WHAT ELSE IT NEED...........
To MAKE it WORK ..............
IT will compile..............
You need READ WAM FRIST That will help you with what PJ was talking about and what
i put in RED
I hope this help you
Sam
Post Edited (sam_sam_sam) : 5/8/2006 10:53:40 PM GMT
First I modified my code based on what Sam showed. It was a good progress but the "cycle" on my code gave me an error: " Label is missing':' ." I realized I was making the same type of error which was I didn’t define "cycle" in PBASIC. Next, I defined cycle as a VARiable "cycle VAR Byte" and wolla!, it compiled. Now the question is I don’t know when it compiled it did what it suppose to do[noparse]:)[/noparse] I can only be sure if I connect it to the circuit board but I am concern to burn BS2 and who knows what kind of suprises are waiting for me[noparse]:)[/noparse]. Any suggestion? Now I am gonna go head and create the flow chart for a better communication as PJ pointed.
PS.
Please advice where can I find and read and understand what WAM is as Sam suggested. I am not sure what READ WAM means. Is it a programming vocabulary as in ROM or an information you can read from a book?Regards,
Regards,
"WAM" is just forum shorthamd (unfortunately) for the fine Parallax Educational Text (and Kit) called "What's A Microcontroller" (ergo W-A-M). You can find that text here, free for the download:
http://www.parallax.com/detail.asp?product_id=28152
It's VERY informative and educational, and geared toward the "newly inititated"
Please enjoy it, along with all the other fine Educational Texts Parallax offers.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
Post Edited (Bruce Bates) : 5/9/2006 1:49:01 AM GMT
Regards,
Utku
I've attached what I think is a "pro" version of your program.· For what I consider "pro" techniques you might want to download and read· StampWorks after you've finished WAM.· WAM + StampWorks will put you in great shape to take these kinds of projects.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Post Edited (Jon Williams (Parallax)) : 5/9/2006 3:17:11 AM GMT
All I want to do is:
Run the re-circulation pump to fill the tanks and keep them cool-it takes ~10 min to fill, but continues run
Run the 3 pumps for 60 min
Stop the 3 pumps for 10 sec
Repeat this 23 times~1 day
‘At the end of the day, empty out the tanks to the reservoir”
Turn off all the pumps
Turn on all the valves-takes 1min fully open
Wait 10 min to emty out the tanks to the reservoir
Turn off all the valves-takes 1 min fully closed
Turn on the heater to dry out the jets in the tank-takes 20 min to dry.
Repeat from the beginning.
I read your “pro” version and obviously I didn’t understand many part of it since I am an entry-level programmer. My constrain here is the time since my two bosses are on top of me. I will be happy to use your “pro” version WHILE I am improving my programming skills to write my own. However, I am concern that if I need to change any numbers such as repetition time or amount of minutes it takes to empty out the tanks, the changes may cause the programming to fail. The program I was trying to write might be too amateurish but it is very simple, I can understand, and wrong[noparse]:)[/noparse]. That being said, if you can “rewrite my program in just a few minutes” I would love to continue in this journey with your edition.
And the most important! thanks a lot for all the help you are providing.!
Regards,
Utku
Post Edited (turkeyus) : 5/9/2006 8:22:35 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
I am studying WMA. In the mean time I tried your code but it didn’t work; only my pump2 relay LED was blinking. Hopefully I will be able to figure it out soon; before I got fired[noparse]:)[/noparse]
Regards,
Utku
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax