Yes, ThunderBorg can control a push and pull solenoid.
Connect the solenoid up like a standard motor, then work out the correct drive power as follows:
drivePower = solenoidVoltage / batteryVoltage
For example a 5V solenoid with a 9V battery would be:
drivePower = 5.0 / 9.0
You can then drive the solenoid as follows:
# Move one way, then turn the power off
TB.SetMotor1(+drivePower)
time.sleep(1)
TB.SetMotor1(0)
# Move the other way, then turn the power off
TB.SetMotor1(-drivePower)
time.sleep(1)
TB.SetMotor1(0)
If it is connected to M2 instead of M1 use SetMotor2 instead.
piborg
Fri, 02/21/2020 - 09:57
Permalink
ThunderBorg and solenoids
Yes, ThunderBorg can control a push and pull solenoid.
Connect the solenoid up like a standard motor, then work out the correct drive power as follows:
For example a 5V solenoid with a 9V battery would be:
You can then drive the solenoid as follows:
If it is connected to M2 instead of M1 use
SetMotor2
instead.