Beagle Board - beagleboard.org
De Funct
Published © GPL3+

MotorCape and the BBBW Can Make Motors Move!

Making some motors move for starters...

EasyWork in progress1 hour134
MotorCape and the BBBW Can Make Motors Move!

Things used in this project

Hardware components

BeagleBone Black Wireless
BeagleBoard.org BeagleBone Black Wireless
×1
BeagleBoard.org MotorCape
×1
DC motor (generic)
×1
12v SLA Battery
×1

Software apps and online services

systemd service file
debian
BeagleBoard.org images for the BeagleBoneBlack and variations

Story

Read more

Schematics

The BBB.io People and GHI Make the MotorCape a Reality!

Look at its glory and use it!

motocape

Do it and doing it are two separate things...

Code

Some software...

Python
I found this software from a fellow on #beagle from Freenode...
import Adafruit_BBIO.GPIO as GPIO
import Adafruit_BBIO.PWM as PWM
import time

# definitions

m1_pwm = "P9_16"
m1_dir = "P8_18"
m2_pwm = "P9_14"
m2_dir = "P8_16"
m3_pwm = "P8_13"
m3_dir = "P8_14"
m4_pwm = "P8_19"
m4_dir = "P8_26"

pwm_freq = 2000

# initialization

GPIO.setup( m1_dir, GPIO.OUT )
GPIO.setup( m2_dir, GPIO.OUT )
GPIO.setup( m3_dir, GPIO.OUT )
GPIO.setup( m4_dir, GPIO.OUT )

PWM.start( m1_pwm, 0, pwm_freq )
PWM.start( m2_pwm, 0, pwm_freq )
PWM.start( m3_pwm, 0, pwm_freq )
PWM.start( m4_pwm, 0, pwm_freq )


# tests

GPIO.output( m1_dir, GPIO.LOW )  # m1 forward direction
time.sleep(10)
PWM.set_duty_cycle( m1_pwm, 100 )  # m1 full speed
time.sleep(10)
PWM.set_duty_cycle( m1_pwm,  50 )  # m1 half speed
time.sleep(10)
PWM.set_duty_cycle( m1_pwm,   0 )  # m1 stop
time.sleep(10)

GPIO.output( m1_dir, GPIO.HIGH )  # m1 reverse direction
time.sleep(10)
PWM.set_duty_cycle( m1_pwm, 100 )  # m1 full speed
time.sleep(10)
PWM.set_duty_cycle( m1_pwm,  50 )  # m1 half speed
time.sleep(10)
PWM.set_duty_cycle( m1_pwm,   0 )  # m1 stop
time.sleep(10)

Credits

De Funct

De Funct

8 projects • 7 followers
Stay there and someone will find you...

Comments

Add projectSign up / Login