# python servo.py Angle (0 to 180 x to exit):90 Angle (0 to 180 x to exit):180 Angle (0 to 180 x to exit):0 Angle (0 to 180 x to exit):x #
Text editor powered by tinymce.
# python servo.py Angle (0 to 180 x to exit):90 Angle (0 to 180 x to exit):180 Angle (0 to 180 x to exit):0 Angle (0 to 180 x to exit):x #
# python servo.py Angle (0 to 180 x to exit):90 Angle (0 to 180 x to exit):180 Angle (0 to 180 x to exit):0 Angle (0 to 180 x to exit):x #
Text editor powered by tinymce.
BeagleBone Black | |
Standard Servo | |
or a Micro Servo | |
1 kΩ Resistor (optional) | |
5V Power Supply | |
Female Screw Terminal adaptor | |
Half-sized Breadboard | |
Male to Male Jumpers |
Text editor powered by tinymce.
Text editor powered by tinymce.
Text editor powered by tinymce.
# python Python 2.7.3 (default, Apr 3 2013, 21:37:23) [GCC 4.7.3 20130205 (prerelease)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>>
# python Python 2.7.3 (default, Apr 3 2013, 21:37:23) [GCC 4.7.3 20130205 (prerelease)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>>
>>> PWM.start("P8_13", 95.0, 60) >>> PWM.set_duty_cycle("P8_13", 97.0) >>> PWM.stop("P8_13") >>> PWM.cleanup()
>>> PWM.start("P8_13", 95.0, 60) >>> PWM.set_duty_cycle("P8_13", 97.0) >>> PWM.stop("P8_13") >>> PWM.cleanup()
>>> PWM.start("P8_13", 95.0, 60, 1) >>> PWM.set_duty_cycle("P8_13", 97.0) >>> PWM.stop("P8_13") >>> PWM.cleanup()
>>> PWM.start("P8_13", 95.0, 60, 1) >>> PWM.set_duty_cycle("P8_13", 97.0) >>> PWM.stop("P8_13") >>> PWM.cleanup()
Text editor powered by tinymce.
import Adafruit_BBIO.PWM as PWM servo_pin = "P8_13" duty_min = 3 duty_max = 14.5 duty_span = duty_max - duty_min PWM.start(servo_pin, (100-duty_min), 60.0) while True: angle = raw_input("Angle (0 to 180 x to exit):") if angle == 'x': PWM.stop(servo_pin) PWM.cleanup() break angle_f = float(angle) duty = 100 - ((angle_f / 180) * duty_span + duty_min) PWM.set_duty_cycle(servo_pin, duty)
import Adafruit_BBIO.PWM as PWM servo_pin = "P8_13" duty_min = 3 duty_max = 14.5 duty_span = duty_max - duty_min PWM.start(servo_pin, (100-duty_min), 60.0) while True: angle = raw_input("Angle (0 to 180 x to exit):") if angle == 'x': PWM.stop(servo_pin) PWM.cleanup() break angle_f = float(angle) duty = 100 - ((angle_f / 180) * duty_span + duty_min) PWM.set_duty_cycle(servo_pin, duty)
# python servo.py Angle (0 to 180 x to exit):90 Angle (0 to 180 x to exit):180 Angle (0 to 180 x to exit):0 Angle (0 to 180 x to exit):x #
# python servo.py Angle (0 to 180 x to exit):90 Angle (0 to 180 x to exit):180 Angle (0 to 180 x to exit):0 Angle (0 to 180 x to exit):x #
Text editor powered by tinymce.
Text editor powered by tinymce.
Text editor powered by tinymce.
You have been successfully subscribed to the Notification List for this product and will therefore receive an e-mail from us when it is back in stock!
For security reasons, an e-mail has been sent to you acknowledging your subscription. Please remember that this subscription will not result in you receiving any e-mail from us about anything other than the restocking of this item.
If, for any reason, you would like to unsubscribe from the Notification List for this product you will find details of how to do so in the e-mail that has just been sent to you!