Can't logical AND (&) 2 bits together?
Was trying to clean my code up a bit, and i ran into this odd problem.
I was suprised not to find the answer in the operators section of sx/b help file.
This feels like it has a very simple answer that will make me feel really...simple [noparse]:)[/noparse]
Here is a snip
I get this error when i try to compile:
Full Code here be afraid, its a work in progress. And my first work at that.
I was suprised not to find the answer in the operators section of sx/b help file.
This feels like it has a very simple answer that will make me feel really...simple [noparse]:)[/noparse]
Here is a snip
ir_in_left VAR Bit ir_in_right VAR Bit ir_in_center VAR Bit IR_IN_CENTER = IR_IN_LEFT & IR_IN_RIGHT 'sensor is 0v for detect so 0 AND 0= 0 = yes
I get this error when i try to compile:
sx/b said...
UNKNOWN COMMAND "LET"
Full Code here be afraid, its a work in progress. And my first work at that.
Comments
I will conceal my embarrassment with shock and feigned outrage!!
Thanks Allen [noparse]:D[/noparse]
You can do something like:
IR_IN_Center = IR_IN_Left
IF IR_IN_Center = 1 THEN
IR_IN_Center = IR_IN_Right
ENDIF
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"Educate your children to self-control, to the habit of holding passion and prejudice and evil tendencies subject to an upright and reasoning will, and you have done much to abolish misery from their future and crimes from society"
Benjamin Franklin
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cheap used 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
SX-Video Display Modules www.sxvm.com
Coming soon! Propeller based OSD module www.hittconsulting.com
·