PDA

View Full Version : Parenthases



sv806
04-25-2007, 07:31 AM
a couple codes i found in the help file for pbasic, i was wondering if the ( ) are needed in the first code? and what is bin1 in7, CR do?




Setup:
INPUT 4

Hold:
IF (IN4 = 0) THEN Hold ' Stay here until P4 is 1



---------------------------------------------------------------------



Main:
INPUT 7 ' Make P7 an input
DEBUG "State of P7: ",
BIN1 IN7, CR

OUT7 = 0 ' Write 0 to output latch
DEBUG "After 0 written to OUT7: ",
BIN1 IN7, CR

OUTPUT 7 ' Make P7 an output
DEBUG "After P7 changed to output: ",
BIN1 IN7
END

Franklin
04-25-2007, 09:46 AM
BIN1 IN7, CR is part of the debug statement above it. DEBUG outputs data to the computer on the serial port in this case it prints "State of P7: <binary value of pin7> <carrige return>
IN7 is the input value of pin7

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen

sv806
04-25-2007, 10:03 AM
thank you...now to see if those parenthases are required

curious1
04-25-2007, 10:36 AM
Syntax and ref. man. Page 128

not necessary for pbasic 2.0 and 2.5

Used within an expression will change the order of evaluation. i.e. math problems.

RC