Shop OBEX P1 Docs P2 Docs Learn Events
LSB of Word Variable - how do you move into byte variable? — Parallax Forums

LSB of Word Variable - how do you move into byte variable?

Mr Diesel DudeMr Diesel Dude Posts: 13
edited 2010-03-05 22:28 in General Discussion
In the PWM command, the duty_cycle parameter must be a byte. I am feeding this from a word variable; in essence, I am trying to force a word variable into the space of a byte variable. It does not work. I think I need to truncate the word variable·to the LSB, and then move it into the byte variable...? Is this correct? If so, can anybody tell me how to do it?

Comments

Sign In or Register to comment.