reading IND into a variable
kutalinelucas
Posts: 80
Hey guys. This is my first day with the basic stamp and there's just a few questions I'd like to ask if thats ok...
Firstly, is it OK to read a nibble of the bs_2, say p12 -> p15 into a variable with:
...I can't seem to find how to read a port as opposed to reading a PIN, and the above just seems too simple
secondly, if I declaire a byte and store say IND to a variable, will it just pad the top four bits with zeros?
I could post my code to try to explain where I'm going if you think it may help
Cheers
Firstly, is it OK to read a nibble of the bs_2, say p12 -> p15 into a variable with:
Data_lines VAR IND Upper_nibble VAR Byte Upper_nibble = Data_lines
...I can't seem to find how to read a port as opposed to reading a PIN, and the above just seems too simple
secondly, if I declaire a byte and store say IND to a variable, will it just pad the top four bits with zeros?
I could post my code to try to explain where I'm going if you think it may help
Cheers
Comments
The PIN statement is a sort of fudge. Some places in PBasic require a bit value (like IN3) and others require an I/O pin number (like HIGH 3). PIN allow you to declare a name that can be used in either case and the compiler figures out which one you need from context.