Morris Beasley
Manufacturing Test Technician
B.S. Industrial Technology (2007)
For more information on our robotics, please visit:
http://www.ish-electronics.webs.com
LIGHT is a Word, PORT is a BYTE... this is always hard to fit 16bits in a 8 bit register huh?
LIGHT>>2 - yes it shift two position to the right... yes you miss bit0 and bit1, but the next lines
PORTD.6 = LIGHT.0
PORTD.7 = LIGHT.1
place them on PORTD.
no lost at all.
None of your bit are lost LIGHT>>2 as long as you dont use something like
LIGHT=LIGHT>>2
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
ok i was thinking that bit 0 and bit 1 would just be moved to where bits 2 and bits 3 are... thus showing bits 0 and 1 twice and losing bits 8 and 9 with the code you provided me with... i'll give it a shot and see what happens...
Last edited by mcbeasleyjr; - 29th January 2009 at 17:38.
Morris Beasley
Manufacturing Test Technician
B.S. Industrial Technology (2007)
For more information on our robotics, please visit:
http://www.ish-electronics.webs.com
Bookmarks