In SX Microcontrollers, SX/B Compiler and SX-Key Tool, cano3d wrote: Would someone help me, I can't get to work the SX for controlling a hobby servo , I tried the PWM command, but its giving me some error that says "byte parameter expected" what I wrote., well actually I used the template that comes in the help. ********** ' ------------------------------------------------------------------------- ' Device Settings ' ------------------------------------------------------------------------- DEVICE SX28, OSC4MHZ, TURBO, STACKX, OPTIONX FREQ 4_000_000 ' ------------------------------------------------------------------------- ' IO Pins ' ------------------------------------------------------------------------- Sio VAR Ra.0 ' 1 IO pin ' ------------------------------------------------------------------------- INTERRUPT ' ------------------------------------------------------------------------- ISR_Start: ' ISR code here ISR_Exit: RETURNINT ' {cycles} ' ========================================================================= PROGRAM Start ' ========================================================================= Pgm_ID: DATA "SX/B Template", 0 ' ------------------------------------------------------------------------- ' Program Code ' ------------------------------------------------------------------------- Start: ' initialization code here Main: ' main code here pwm RA.0, .0015, 8 'What I expect here is that on port RA.0 i will get a PWM signal with .0015 seconds of duty cycle and for 8 seconds of duration. GOTO Main ******************** the idea of the project is to control a robot and to vary the times on each servo to make it move while the other servos stay in the same position..., I know I am far from that, but, well I gotta make 1 servo move first lol.. thanks. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=112738 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)