In SX Microcontrollers, SX/B Compiler and SX-Key Tool, bean wrote: You had asked about an SX/B version of the PWM code. Here it is. Now this NOT the most effecient code, but it does show what's going on... [code] PWM_Count VAR BYTE PWM_Values VAR BYTE (4) INTERRUPT INC PWM_Count IF PWM_Values(0) > PWM_Count THEN RB.0 = 1 ELSE RB.0 = 0 ENDIF IF PWM_Values(1) > PWM_Count THEN RB.1 = 1 ELSE RB.1 = 0 ENDIF IF PWM_Values(2) > PWM_Count THEN RB.2 = 1 ELSE RB.2 = 0 ENDIF IF PWM_Values(3) > PWM_Count THEN RB.3 = 1 ELSE RB.3 = 0 ENDIF RETURNINT [/code] Bean. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=153024#m153081 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)