Ok have answer to if then
Archiver
Posts: 46,084
SORRY ALL
Penny just dropped, define it at the top as you showed Jon
I forgot / thought being out of variable it meant I couldn't do it but
putting
TestPin PIN 3
at the top makes it work... sorry I missed that
Thanks all
> > TestPin PIN 3
> >
> > Check:
> > IF (TestPin = 1) AND (x > 5) AND (x < 8) THEN
> > ' program continue block
> > ELSE
> > ' program block
> > ENDIF
Rob Farrand
Original Message
From: "Rob Farrand ... FTech Connection" <ftech@n...>
To: <basicstamps@yahoogroups.com>
Sent: Tuesday, December 30, 2003 1:29 PM
Subject: Re: [noparse][[/noparse]basicstamps]
> THANK YOU JON!
> Though question (Please) below on what you wrote
> Jon wrote:
> You might use IF-THEN-ELSE if your statement blocks aren't unruly:
> >
> >
> > TestPin PIN 3
> >
> > Check:
> > IF (TestPin = 1) AND (x > 5) AND (x < 8) THEN
> > ' program continue block
> > ELSE
> > ' program block
> > ENDIF
>
> My problem
>
> I think the problem I have is what do you call pin 3 so as the checker
> doesn't ask "undefined symbol".
> Your set out is much neater and I will try that but can you explain to me
> what must be obvious and simple to others, but I just seem to miss it!!
> In this line
>
> IF (TestPin = 1) AND (x > 5) AND (x < 8) THEN
>
> What do I call pin 3..( I tried Pin3). i.e. type in "test" the pin has no
> symbol name, its just switching a LED on and off and I need to know if it
is
> on as a variable in the IF THEN!
>
> hope that makes sense!
> Thanks
>
> Rob Farrand
> Ftech Connection Pty Ltd
>
> This email is confidential and may also be privilege.
> If you are not the intended recipient, please notify us immediately.
> You should not copy or use it for any purpose, nor disclose it's contents
to
> any other person.
>
>
>
Original Message
> From: "Jon Williams" <jwilliams@p...>
> To: <basicstamps@yahoogroups.com>
> Sent: Tuesday, December 30, 2003 1:10 PM
> Subject: [noparse][[/noparse]basicstamps]
>
>
> > You might use IF-THEN-ELSE if your statement blocks aren't unruly:
> >
> >
> > TestPin PIN 3
> >
> > Check:
> > IF (TestPin = 1) AND (x > 5) AND (x < 8) THEN
> > ' program continue block
> > ELSE
> > ' program block
> > ENDIF
> >
> >
> > This code requires the $PBASIC 2.5 directive, available in version 2.x
> > of our compiler. I suggest you download the latest version (2.1, Beta
> > 1).
> >
> > -- Jon Williams
> > -- Parallax
> >
> >
> >
Original Message
> > From: Rob Farrand ... FTech Connection
> > [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=NdIm3kzB4JzP-CZcyekjFyl6ohprIQRqDpPv9ApyRdNetY2dnUtR7CwlhZknzAJjo5LSF5AWpXiZj0bZV6MF-6Y]ftech@n...[/url
> > Sent: Monday, December 29, 2003 8:29 PM
> > To: basicstamps@yahoogroups.com
> > Subject: [noparse][[/noparse]basicstamps] IF THEN STATMENT CHECKING PIN STATE
> >
> >
> > Hi All
> > Been some cool and helpful topics on the board thanks!
> >
> > I have what is possibly a simple question but not sure of the command
> > for it. I would like to write a IF THEN statement that relies on if a
> > output pin or group of output pins are high.
> >
> > IE not in correct code but idea
> >
> > CHECK:
> > IF PIN 3 IS HIGH AND X>5 AND X<8 THEN PROGRAMCONTINUE
> > GOTO PROGRAM
> >
> > PROGRAMCONTINE:
> > XXXXXX
> >
> > I have no more variables to use in this code as they are all taken up. I
> > don't want to wait for the pin to go high just check its state and then
> > if it is high and the other variables are correct go to PROGRAMCONTINUE
> > or other name. Also I don't want to change the state of the output pin
> > either just check its state.
> >
> >
> > Thanks
> > Rob
> >
> > [noparse][[/noparse]Non-text portions of this message have been removed]
> >
> >
> > To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@yahoogroups.com
> > from the same email address that you subscribed. Text in the Subject
> > and Body of the message will be ignored.
> >
> >
> > Yahoo! Groups Links
> >
> > To visit your group on the web, go to:
> > http://groups.yahoo.com/group/basicstamps/
> >
> > To unsubscribe from this group, send an email to:
> > basicstamps-unsubscribe@yahoogroups.com
> >
> > Your use of Yahoo! Groups is subject to:
> > http://docs.yahoo.com/info/terms/
> >
> >
> >
> >
> > This message has been scanned by WebShield. Please report SPAM to
> > abuse@p....
> >
> >
> > To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@yahoogroups.com
> > from the same email address that you subscribed. Text in the Subject
and
> Body of the message will be ignored.
> >
> >
> > Yahoo! Groups Links
> >
> > To visit your group on the web, go to:
> > http://groups.yahoo.com/group/basicstamps/
> >
> > To unsubscribe from this group, send an email to:
> > basicstamps-unsubscribe@yahoogroups.com
> >
> > Your use of Yahoo! Groups is subject to:
> > http://docs.yahoo.com/info/terms/
> >
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
>
>
> Yahoo! Groups Links
>
> To visit your group on the web, go to:
> http://groups.yahoo.com/group/basicstamps/
>
> To unsubscribe from this group, send an email to:
> basicstamps-unsubscribe@yahoogroups.com
>
> Your use of Yahoo! Groups is subject to:
> http://docs.yahoo.com/info/terms/
>
Penny just dropped, define it at the top as you showed Jon
I forgot / thought being out of variable it meant I couldn't do it but
putting
TestPin PIN 3
at the top makes it work... sorry I missed that
Thanks all
> > TestPin PIN 3
> >
> > Check:
> > IF (TestPin = 1) AND (x > 5) AND (x < 8) THEN
> > ' program continue block
> > ELSE
> > ' program block
> > ENDIF
Rob Farrand
Original Message
From: "Rob Farrand ... FTech Connection" <ftech@n...>
To: <basicstamps@yahoogroups.com>
Sent: Tuesday, December 30, 2003 1:29 PM
Subject: Re: [noparse][[/noparse]basicstamps]
> THANK YOU JON!
> Though question (Please) below on what you wrote
> Jon wrote:
> You might use IF-THEN-ELSE if your statement blocks aren't unruly:
> >
> >
> > TestPin PIN 3
> >
> > Check:
> > IF (TestPin = 1) AND (x > 5) AND (x < 8) THEN
> > ' program continue block
> > ELSE
> > ' program block
> > ENDIF
>
> My problem
>
> I think the problem I have is what do you call pin 3 so as the checker
> doesn't ask "undefined symbol".
> Your set out is much neater and I will try that but can you explain to me
> what must be obvious and simple to others, but I just seem to miss it!!
> In this line
>
> IF (TestPin = 1) AND (x > 5) AND (x < 8) THEN
>
> What do I call pin 3..( I tried Pin3). i.e. type in "test" the pin has no
> symbol name, its just switching a LED on and off and I need to know if it
is
> on as a variable in the IF THEN!
>
> hope that makes sense!
> Thanks
>
> Rob Farrand
> Ftech Connection Pty Ltd
>
> This email is confidential and may also be privilege.
> If you are not the intended recipient, please notify us immediately.
> You should not copy or use it for any purpose, nor disclose it's contents
to
> any other person.
>
>
>
Original Message
> From: "Jon Williams" <jwilliams@p...>
> To: <basicstamps@yahoogroups.com>
> Sent: Tuesday, December 30, 2003 1:10 PM
> Subject: [noparse][[/noparse]basicstamps]
>
>
> > You might use IF-THEN-ELSE if your statement blocks aren't unruly:
> >
> >
> > TestPin PIN 3
> >
> > Check:
> > IF (TestPin = 1) AND (x > 5) AND (x < 8) THEN
> > ' program continue block
> > ELSE
> > ' program block
> > ENDIF
> >
> >
> > This code requires the $PBASIC 2.5 directive, available in version 2.x
> > of our compiler. I suggest you download the latest version (2.1, Beta
> > 1).
> >
> > -- Jon Williams
> > -- Parallax
> >
> >
> >
Original Message
> > From: Rob Farrand ... FTech Connection
> > [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=NdIm3kzB4JzP-CZcyekjFyl6ohprIQRqDpPv9ApyRdNetY2dnUtR7CwlhZknzAJjo5LSF5AWpXiZj0bZV6MF-6Y]ftech@n...[/url
> > Sent: Monday, December 29, 2003 8:29 PM
> > To: basicstamps@yahoogroups.com
> > Subject: [noparse][[/noparse]basicstamps] IF THEN STATMENT CHECKING PIN STATE
> >
> >
> > Hi All
> > Been some cool and helpful topics on the board thanks!
> >
> > I have what is possibly a simple question but not sure of the command
> > for it. I would like to write a IF THEN statement that relies on if a
> > output pin or group of output pins are high.
> >
> > IE not in correct code but idea
> >
> > CHECK:
> > IF PIN 3 IS HIGH AND X>5 AND X<8 THEN PROGRAMCONTINUE
> > GOTO PROGRAM
> >
> > PROGRAMCONTINE:
> > XXXXXX
> >
> > I have no more variables to use in this code as they are all taken up. I
> > don't want to wait for the pin to go high just check its state and then
> > if it is high and the other variables are correct go to PROGRAMCONTINUE
> > or other name. Also I don't want to change the state of the output pin
> > either just check its state.
> >
> >
> > Thanks
> > Rob
> >
> > [noparse][[/noparse]Non-text portions of this message have been removed]
> >
> >
> > To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@yahoogroups.com
> > from the same email address that you subscribed. Text in the Subject
> > and Body of the message will be ignored.
> >
> >
> > Yahoo! Groups Links
> >
> > To visit your group on the web, go to:
> > http://groups.yahoo.com/group/basicstamps/
> >
> > To unsubscribe from this group, send an email to:
> > basicstamps-unsubscribe@yahoogroups.com
> >
> > Your use of Yahoo! Groups is subject to:
> > http://docs.yahoo.com/info/terms/
> >
> >
> >
> >
> > This message has been scanned by WebShield. Please report SPAM to
> > abuse@p....
> >
> >
> > To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@yahoogroups.com
> > from the same email address that you subscribed. Text in the Subject
and
> Body of the message will be ignored.
> >
> >
> > Yahoo! Groups Links
> >
> > To visit your group on the web, go to:
> > http://groups.yahoo.com/group/basicstamps/
> >
> > To unsubscribe from this group, send an email to:
> > basicstamps-unsubscribe@yahoogroups.com
> >
> > Your use of Yahoo! Groups is subject to:
> > http://docs.yahoo.com/info/terms/
> >
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
>
>
> Yahoo! Groups Links
>
> To visit your group on the web, go to:
> http://groups.yahoo.com/group/basicstamps/
>
> To unsubscribe from this group, send an email to:
> basicstamps-unsubscribe@yahoogroups.com
>
> Your use of Yahoo! Groups is subject to:
> http://docs.yahoo.com/info/terms/
>