View Single Post
  #1   Spotlight this post!  
Unread 17-02-2005, 18:49
wildabyss wildabyss is offline
Registered User
#0919
 
Join Date: Feb 2005
Location: Toronto
Posts: 10
wildabyss is an unknown quantity at this point
To control motor's rotation...

Hi

I'm trying to control the motor's rotation with a button
I want the motor to turn certain degrees when a button is pressed

so i built a function called MotorDegree, and used For loop to control the rotation. [pwm01 = MotorDegree(p1_sw_trig)]

But it appears that the motor's movement (pwm01) doesn't require the button's activation (p1_sw_trig). It turns automatically once the robot initiates.

I used If command in the function so that the function runs only if the trigger is pressed (when it's 1 or above 0)

What is wrong?