PropBasic - ina[8..15]
hi, what I want to do is read the input register, P8 thru P15,
and assign it to a variable like in spin·· value := ina[noparse][[/noparse]8..15]
·
How can I do this in PropBasic ??· thanks
and assign it to a variable like in spin·· value := ina[noparse][[/noparse]8..15]
·
How can I do this in PropBasic ??· thanks
Comments
Pins PIN 8..15 INPUT
value·var long
Program Start
Start:
value·=Pins
·END
Gerry
Switch PIN 7..0
and...
Switch PIN 0..7
... have the LSB and MSB pins reversed, so having %00001111 on P7..P0 will return $0F with the first declaration, but $F0 with the second due to the reversal. As with Spin, this can be a useful feature.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon McPhalen
Hollywood, CA
needs 16 ticks of the system clk. If I use value1 = ina then
only 4 ticks are needed but then I have to apply a mask to get
the desired bits. I want to use this 100 times to accumalate
ADC data which would require variables value1 thru value100. Any
thoughts as how to do this will be appreciated
ASM mov __temp1, ina shr __temp1, #8 and __temp1, #$FF ENDASM
At the end of this routine __temp1 holds the bits you seek; you can mix this into your PropBASIC code.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon McPhalen
Hollywood, CA