schiftl of shiftr
Hi
I'm working on a little project that is reading pulses on an input an generating pulses after modification on an output.
I'm using shift to read from a pin into an byte.
I'm using also shift to shift a byte back out to an other pin.
Now my· question. Is thier a way to schift from on byte to an other byte. (not to a hardware output)
example.·myvar = 10001100 ( this can be any number depending on what I read)
I want to create 8 byte var where the first is bit 1 of myvar (0) and the last is bit 8 of myvar (1)
(var1=0, var2=0, var3=1, var4=1, var5=0, var6=0, var7=0,var8=1)
This I need in a routine that when I read myvar i can automatic change var1 until var8 depending on the value in myvar.
Is this possible in a sx28 using sx/b???
stef
I'm working on a little project that is reading pulses on an input an generating pulses after modification on an output.
I'm using shift to read from a pin into an byte.
I'm using also shift to shift a byte back out to an other pin.
Now my· question. Is thier a way to schift from on byte to an other byte. (not to a hardware output)
example.·myvar = 10001100 ( this can be any number depending on what I read)
I want to create 8 byte var where the first is bit 1 of myvar (0) and the last is bit 8 of myvar (1)
(var1=0, var2=0, var3=1, var4=1, var5=0, var6=0, var7=0,var8=1)
This I need in a routine that when I read myvar i can automatic change var1 until var8 depending on the value in myvar.
Is this possible in a sx28 using sx/b???
stef
Comments
Note that this will destory the value in myVar...
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
Post Edited (Bean (Hitt Consulting)) : 1/30/2007 1:37:13 PM GMT
Thanks for the response. I understand the routine. I oversaw the >> 1 command.
Just one litle question : In "result(cnt) = myvar.0" What is the reason of the ".0"? Can it also work with just "result(cnt) = myvar"
It is just to understand the reason. I like to understand what I do.
Stef
The ".0" means you only want the value of bit 0. A zero or a one.
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
I seached all my doc and found nothing on it.
Deamed you are good. I still need a lot to learn. Where can I find more on this??
Thanks anyway. I implemented the routine in my program (with a bit of modification on it but I don't think you mind.)
stef