thunderborg GPIO pins
Forums:
I am VERY new to this so possibly a daft question but can i control a motor (linear actuator) by sending LOW/HIGH command to a specific Raspberry Pi GPIO pin eg. GPIO.setup(21,GPIO.LOW) ?
Secondary question is how do I reverse polarity ?
thanks
- Log in to post comments

piborg
Sat, 03/16/2019 - 11:32
Permalink
ThunderBorg uses I2C
The ThunderBorg works by sending commands over the GPIO using messages known as I2C. This is done over the SDA and SCL pins on the GPIO connection.
The ThunderBorg examples (install instructions found here) have a library, ThunderBorg.py, which makes controlling the motors simple :)
Here is a basic example of driving motor #1 in both directions:
# Load the ThunderBorg library
import
ThunderBorg
# Load the standard time library
import
time
# Setup the ThunderBorg so it is ready to use
TB
=
ThunderBorg.ThunderBorg()
TB.Init()
# Determine the maximum power output
batteryVoltage
=
12.0
motorVoltage
=
6.0
maxPower
=
motorVoltage
/
batteryVoltage
# Run motor 1 forwards at half power
# for 2 seconds, then stop motor 1
TB.SetMotor1(
0.5
*
maxPower)
time.sleep(
2.0
)
TB.SetMotor1(
0
)
# Run motor 1 backwards at 3/4 power
# for 1 second, then stop motor 1
TB.SetMotor1(
-
0.75
*
maxPower)
time.sleep(
1.0
)
TB.SetMotor1(
0
)
stephenjeffers@...
Sat, 03/16/2019 - 16:29
Permalink
brilliant
works a treat, thanks !