converting input pins to a decimal number?
grkblood13
Posts: 31
hey, im new to the basic stamp.·I have an A/D converter and·I am trying to find a way to convert a string of high and low signals (P0-P7) into a decimal number. Can any1 help me out with this? Thanks in advance.
Comments
By (P0-P7) do you mean the 8 signals are on pin 0 thru pin 7 (using 8 pin of the basic stamp) ?
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
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
Stuff I'm selling on ebay http://search.ebay.com/_W0QQsassZhittconsultingQQhtZ-1
"USA Today has come out with a new survey - apparently, three out of every four people make up 75% of the population." - David Letterman
value var byte
value=INL
debug DEC value
Jeff T.
MyWord = INS & $01FF ' This 'masks' off the 'don't care' bits
' Note any pins set for 'input' or 'output' will remain set that way.
' Any pin set for output will return the value last sent to the 'output latch',
' but you mask that value off as a 'don't care'.
' But reading that bit won't affect its input/output state, or its value, so
' you can do that without having a 'bad effect'.