Shop OBEX P1 Docs P2 Docs Learn Events
Basic Stamp II Question — Parallax Forums

Basic Stamp II Question

wonkawonka Posts: 12
edited 2005-04-22 01:34 in BASIC Stamp
I have a question that deal with my basic Stamp two. I have a simple program I want to run attach to the letter. The problem that I am having is it will only run threw the program twice or not even that. Then I have to reset it by using the reset button on the board. Also if I edit anytiming to make longer it keeps one of my output always on.


adam

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-04-22 00:38
    Adam,

    ·· Is that LOW 12 in the second hold routine supposed to be there? You already performed it right above where it says ignitor off.· If IN15 never reaches 1, then you're stuck in that bottom loop.

    ·· I would try adding a DEBUG statement in there to track where the program is hanging up.· Perhaps use a:

    DEBUG "Ignitor Off...Switch position =", DEC switch
    

    ·· Of course, switch could be aliased to your input PIN.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • wonkawonka Posts: 12
    edited 2005-04-22 00:47
    I want it to be stuck in the bottem loop untill i turn my remote off wich is 0
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-04-22 00:53
    wonka,

    ·· If it's a 0 you'll be stuck there forever.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • wonkawonka Posts: 12
    edited 2005-04-22 00:57
    dwould you have a idea in how to fix it. See what i am trying to do is to start that process from a input then once it is done i want the soleniod to stay on untill i turn if off by the input. once it is turn off i want it to go back to the main where i can sart back over by the input
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-04-22 00:59
    wonka,

    ·· All I'm saying is that, in your code, you are waiting in a loop and if IN15 = 0 then you stay in the loop.· You posted that you wanted to stay in the loop until the input is 0.· But that will keep it in the loop.· So perhaps you mean to change the IN15 line to "IF IN15 = 1 THEN?"· That way it will stay in the loop while the input = 1, but will exit when it's 0, which is what you said you·wanted.




    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • wonkawonka Posts: 12
    edited 2005-04-22 01:07
    Alright i have on and off backwards I am sinking my reciever to ground because it just a contact. SO it start out as a 1. so once it goes to 0 it goes through the code. and the end of the code i want to use my input to turn it off wich would be a 1 and goto the main and start the process over buy looking for another 0
  • wonkawonka Posts: 12
    edited 2005-04-22 01:11
    Sorry here is a better version of my code wich i want to work that way but It will not either
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-04-22 01:17
    wonka,

    ·· Once again, in your new code, you're waiting in a loop while the input = 0, and from what you said, your OFF position = 0, so that's probably where you're hanging up.· Did you try using DEBUG to see if you're getting the signals you expect where/when you want?· It's a great troubleshooting tool.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • wonkawonka Posts: 12
    edited 2005-04-22 01:25
    i do not know how to use debug
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-04-22 01:34
    wonka,

    ·· Click on the HELP icon on the top-right side of the Stamp Editor.· It's a little icon that looks like a purple book with a question mark on it.· When the help file opens, click on PBASIC reference, then DEBUG.· Better yet, go to the Parallax web page, click on books, then scroll down to the "What's A Microcontroller?" text.· Click on it, scroll down to downloads, and download the PDF file.· Read through it before attempting to take on a project like this.· It will help you understand how to program and interface to the BASIC Stamp Microcontroller.

    ·· Please do not take offense to this, but if you're trying to control a GAS Grill, which it looks like you are, then you really should learn what you're doing before trying to control the gas solenoid and ignitor.· One wrong move and kaboom!· I, personally don't want to take responsibility for telling how to make the program work if you don't understand how the code works.· Please read the recommended text before pursuing this any further.· I'm just thinking of your personal safety!· smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com


    Post Edited (Chris Savage (Parallax)) : 4/22/2005 1:38:31 AM GMT
Sign In or Register to comment.