2015-04-11 06:32:08 +08:00
|
|
|
<!--
|
|
|
|
---
|
2016-06-25 06:26:20 +08:00
|
|
|
name: Motor Controller Board
|
2016-01-31 19:03:17 +08:00
|
|
|
class: board
|
|
|
|
type: motor
|
2016-06-25 23:56:10 +08:00
|
|
|
image: 'rtk-000-001.png'
|
2015-04-11 06:32:08 +08:00
|
|
|
manufacturer: Ryanteck
|
2015-12-30 01:49:41 +08:00
|
|
|
description: A quick and easy way to start driving motors on your Raspberry Pi
|
2015-11-10 07:44:51 +08:00
|
|
|
url: https://ryanteck.uk/add-ons/6-ryanteck-rpi-motor-controller-board-0635648607160.html
|
|
|
|
buy: https://ryanteck.uk/add-ons/6-ryanteck-rpi-motor-controller-board-0635648607160.html
|
2015-12-30 01:49:41 +08:00
|
|
|
formfactor: '26-way'
|
2015-04-11 06:32:08 +08:00
|
|
|
pincount: 26
|
2015-12-30 01:49:41 +08:00
|
|
|
eeprom: no
|
2015-04-11 06:32:08 +08:00
|
|
|
pin:
|
|
|
|
'11':
|
|
|
|
name: Motor 1 A
|
|
|
|
direction: output
|
|
|
|
active: high
|
|
|
|
'12':
|
|
|
|
name: Motor 1 B
|
|
|
|
direction: output
|
|
|
|
active: high
|
|
|
|
'15':
|
|
|
|
name: Motor 2 A
|
|
|
|
direction: output
|
|
|
|
active: high
|
|
|
|
'16':
|
|
|
|
name: Motor 2 B
|
|
|
|
direction: output
|
|
|
|
active: high
|
|
|
|
-->
|
2015-03-22 07:04:31 +08:00
|
|
|
#Ryanteck Motor Controller Board
|
|
|
|
|
|
|
|
###A quick and easy way to start driving motors on your Raspberry Pi
|
|
|
|
|
|
|
|
```python
|
|
|
|
##Simple motor script for the RTK-000-001
|
|
|
|
import RPi.GPIO as GPIO
|
|
|
|
import time
|
|
|
|
#Set to broadcom pin numbers
|
|
|
|
GPIO.setmode(GPIO.BCM)
|
|
|
|
|
|
|
|
#Motor 1 = Pins 17 and 18
|
|
|
|
#Motor 2 = Pins 22 and 23
|
|
|
|
GPIO.setup(17, GPIO.OUT)
|
|
|
|
GPIO.setup(18, GPIO.OUT)
|
|
|
|
|
|
|
|
#Now loop forever turning one direction for 5 seconds, then the other
|
|
|
|
while (True):
|
|
|
|
#Sleep 1 second then turn 17 on
|
|
|
|
GPIO.output(18, 0)
|
|
|
|
time.sleep(1)
|
|
|
|
GPIO.output(17, 1);
|
|
|
|
time.sleep(5);
|
|
|
|
#And now the other way round
|
|
|
|
GPIO.output(17, 0)
|
|
|
|
time.sleep(1);
|
|
|
|
GPIO.output(18, 1);
|
|
|
|
time.sleep(5);
|
|
|
|
#And loop back around
|
|
|
|
#And final cleanup
|
|
|
|
GPIO.cleanup()
|
2016-01-31 19:03:17 +08:00
|
|
|
```
|