67 lines
1.2 KiB
Markdown
67 lines
1.2 KiB
Markdown
|
<!--
|
||
|
---
|
||
|
name: RTK Motor Controller
|
||
|
class: board
|
||
|
type: motor
|
||
|
formfactor: Custom
|
||
|
manufacturer: Ryanteck
|
||
|
description: A quick and easy way to start driving motors on your Raspberry Pi
|
||
|
github: https://github.com/PiSupply/Ryanteck/tree/master/RTK%20Motor%20Controller
|
||
|
buy: https://uk.pi-supply.com/products/ryanteck-rtk-000-001-motor-controller-board-kit-raspberry-pi
|
||
|
image: 'rtk-000-001.png'
|
||
|
pincount: 26
|
||
|
eeprom: no
|
||
|
power:
|
||
|
'1':
|
||
|
'2':
|
||
|
ground:
|
||
|
'6':
|
||
|
'9':
|
||
|
'14':
|
||
|
'20':
|
||
|
'25':
|
||
|
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
|
||
|
-->
|
||
|
# RTK Motor Controller
|
||
|
|
||
|
A quick and easy way to start driving motors on your Raspberry Pi
|
||
|
|
||
|
## Code
|
||
|
|
||
|
```python
|
||
|
from gpiozero import RyanteckRobot
|
||
|
from time import sleep
|
||
|
|
||
|
robot = RyanteckRobot()
|
||
|
|
||
|
while True:
|
||
|
robot.forward()
|
||
|
sleep(5)
|
||
|
robot.left()
|
||
|
sleep(1)
|
||
|
robot.backward()
|
||
|
sleep(5)
|
||
|
robot.right()
|
||
|
sleep(1)
|
||
|
robot.stop()
|
||
|
sleep(1)
|
||
|
```
|
||
|
|
||
|
[GPIO Zero docs](http://gpiozero.readthedocs.io/en/v1.3.1/api_boards.html#ryanteck-mcb-robot)
|