In SX Microcontrollers, SX/B Compiler and SX-Key Tool, kingneb wrote: You can do it by using two bytes to store the 16 bit value. The arethmetic is not hard at all. What I want to do is this. 1. Read a nibble 2. Multiply that nibble by 100 (this is for pulse width modulation, calculating the high delay and the low delay) to get the high duration. 3. Subtract the nibble by 1000 to get the low duration Here is the Picbasic code: [code] high_dur var word low_dur var word here: high_dur = ra * 100 'multiply the ra channel by 100 to get high duration low_dur = high_dur - 1000 'get low duration high rb.0 pause_us high_dur low rb.0 pause_us low_dur goto here Thanks, kingneb ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=90755#m90779 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)