Merge pull request #128 from bennuttall/rtkmcb

Update RTK MCB in all languages
This commit is contained in:
RM 2016-10-19 13:20:25 +01:00 committed by GitHub
commit ff970f9bd6
6 changed files with 96 additions and 122 deletions

View File

@ -1,6 +1,6 @@
<!-- <!--
--- ---
name: Motorsteuerung name: RTK Motorsteuerung
class: board class: board
type: alle type: alle
formfactor: Andere formfactor: Andere
@ -34,31 +34,22 @@ pin:
###Ein schneller und einfacher Weg um Motoren mit deinem Pi zu steuern. ###Ein schneller und einfacher Weg um Motoren mit deinem Pi zu steuern.
```python ```python
##Simples Motor Script für den RTK-000-001 from gpiozero import RyanteckRobot
import RPi.GPIO as GPIO from time import sleep
import time
#Setze BCM Broadcom Pin Nummern
GPIO.setmode(GPIO.BCM)
#Motor 1 = Pins 17 and 18 robot = RyanteckRobot()
#Motor 2 = Pins 22 and 23
GPIO.setup(17, GPIO.OUT)
GPIO.setup(18, GPIO.OUT)
#Jetzt wird jede Richtung für 5 Sekunden in while True:
#einer Endlosschleife durchlaufen. robot.forward()
while (True): sleep(5)
#Sleep 1 second then turn 17 on robot.left()
GPIO.output(18, 0) sleep(1)
time.sleep(1) robot.backward()
GPIO.output(17, 1); sleep(5)
time.sleep(5); robot.right()
#And now the other way round sleep(1)
GPIO.output(17, 0) robot.stop()
time.sleep(1); sleep(1)
GPIO.output(18, 1);
time.sleep(5);
#And loop back around
#And final cleanup
GPIO.cleanup()
``` ```
[GPIO Zero docs](http://gpiozero.readthedocs.io/en/v1.3.1/api_boards.html#ryanteck-mcb-robot)

View File

@ -1,6 +1,6 @@
<!-- <!--
--- ---
name: Motor Controller Board name: RTK Motor Controller Board
class: board class: board
type: motor type: motor
formfactor: Custom formfactor: Custom
@ -38,9 +38,11 @@ pin:
direction: output direction: output
active: high active: high
--> -->
#Motor Controller Board # RTK Motor Controller Board
###A quick and easy way to start driving motors on your Raspberry Pi A quick and easy way to start driving motors on your Raspberry Pi
## Code
```python ```python
from gpiozero import RyanteckRobot from gpiozero import RyanteckRobot
@ -60,3 +62,5 @@ while True:
robot.stop() robot.stop()
sleep(1) sleep(1)
``` ```
[GPIO Zero docs](http://gpiozero.readthedocs.io/en/v1.3.1/api_boards.html#ryanteck-mcb-robot)

View File

@ -1,6 +1,6 @@
<!-- <!--
--- ---
name: Controlador de Motor name: RTK Controlador de Motor
class: board class: board
type: todas type: todas
formfactor: Otro formfactor: Otro
@ -34,26 +34,22 @@ pin:
###Una manera rápida y fácil de empezar a controlar motores en tu Raspberry Pi ###Una manera rápida y fácil de empezar a controlar motores en tu Raspberry Pi
```python ```python
import RPi.GPIO as GPIO from gpiozero import RyanteckRobot
import time from time import sleep
GPIO.setmode(GPIO.BCM)
#Motor 1 = Pines 17 y 18 robot = RyanteckRobot()
#Motor 2 = Pines 22 y 23
GPIO.setup(17, GPIO.OUT)
GPIO.setup(18, GPIO.OUT)
#Bucle infinito, girando en una dirección 5 segundos, después en la otra while True:
while (True): robot.forward()
GPIO.salida(18, 0) sleep(5)
time.sleep(1) robot.left()
GPIO.salida(17, 1); sleep(1)
time.sleep(5); robot.backward()
#Ahora para el otro lado sleep(5)
GPIO.salida(17, 0) robot.right()
time.sleep(1); sleep(1)
GPIO.salida(18, 1); robot.stop()
time.sleep(5); sleep(1)
#Y limpieza final
GPIO.cleanup()
``` ```
[GPIO Zero docs](http://gpiozero.readthedocs.io/en/v1.3.1/api_boards.html#ryanteck-mcb-robot)

View File

@ -1,6 +1,6 @@
<!-- <!--
--- ---
name: Contrôleur moteur name: RTK Contrôleur moteur
class: board class: board
type: Tous type: Tous
formfactor: Autre formfactor: Autre
@ -31,24 +31,25 @@ pin:
--> -->
#Contrôleur moteur Ryanteck RTK-000-001 #Contrôleur moteur Ryanteck RTK-000-001
###Contrôler un moteur connecté au RTK-000-001 depuis votre Raspberry Pi est aisé: ###Contrôler un moteur connecté au RTK-000-001 depuis votre Raspberry Pi est aisé:
```python ```python
import RPi.GPIO as GPIO from gpiozero import RyanteckRobot
import time from time import sleep
GPIO.setmode(GPIO.BCM) robot = RyanteckRobot()
GPIO.setup(17, GPIO.OUT)
GPIO.setup(18, GPIO.OUT)
while (True): while True:
GPIO.output(18, 0) robot.forward()
time.sleep(1) sleep(5)
GPIO.output(17, 1); robot.left()
time.sleep(5); sleep(1)
GPIO.output(17, 0) robot.backward()
time.sleep(1); sleep(5)
GPIO.output(18, 1); robot.right()
time.sleep(5); sleep(1)
GPIO.cleanup() robot.stop()
``` sleep(1)
```
[GPIO Zero docs](http://gpiozero.readthedocs.io/en/v1.3.1/api_boards.html#ryanteck-mcb-robot)

View File

@ -1,6 +1,6 @@
<!-- <!--
--- ---
name: Motor Controller Board name: RTK Motor Controller Board
class: board class: board
type: Tutti type: Tutti
formfactor: Altro formfactor: Altro
@ -34,31 +34,22 @@ pin:
###Una maniera facile e veloce per controllare dei motori dal tuo Raspberry ###Una maniera facile e veloce per controllare dei motori dal tuo Raspberry
```python ```python
# Semplice script per i motori dell'RTK-000-001 from gpiozero import RyanteckRobot
import RPi.GPIO as GPIO from time import sleep
import time
# Imposta la numerazione Broadcom
GPIO.setmode(GPIO.BCM)
# Motore 1 = Pin 17 e 18 robot = RyanteckRobot()
# Motore 2 = Pin 22 e 23
GPIO.setup(17, GPIO.OUT)
GPIO.setup(18, GPIO.OUT)
# Ora ripeti all'infinito attivando while True:
# alternativamente ogni direzione per 5s robot.forward()
while (True): sleep(5)
# Sleep di 1 secondo, poi attiva il 17 robot.left()
GPIO.output(18, 0) sleep(1)
time.sleep(1) robot.backward()
GPIO.output(17, 1); sleep(5)
time.sleep(5); robot.right()
# Ed ora l'opposto sleep(1)
GPIO.output(17, 0) robot.stop()
time.sleep(1); sleep(1)
GPIO.output(18, 1); ```
time.sleep(5);
# E si ricomincia [GPIO Zero docs](http://gpiozero.readthedocs.io/en/v1.3.1/api_boards.html#ryanteck-mcb-robot)
# Cleanup finale
GPIO.cleanup()
```

View File

@ -1,6 +1,6 @@
<!-- <!--
--- ---
name: Motor Kontrol Kartı name: RTK Motor Kontrol Kartı
class: board class: board
type: hepsi type: hepsi
formfactor: diğer formfactor: diğer
@ -35,31 +35,22 @@ pin:
```python ```python
##RTK-000-001 için basit bir motor scripti from gpiozero import RyanteckRobot
import RPi.GPIO as GPIO from time import sleep
import time
#Pinleri Broadcom Pin'lerine göre ayarlayalım
GPIO.setmode(GPIO.BCM)
#Motor 1 = Pins 17 ve 18 robot = RyanteckRobot()
#Motor 2 = Pins 22 ve 23
GPIO.setup(17, GPIO.OUT)
GPIO.setup(18, GPIO.OUT)
#Şimdi de bir sonsuz döngü içinde motoru önce bir yöne, ve diğer yöne 5er saniye döndürelim: while True:
while (True): robot.forward()
#1 saniye bekle, sonra pin 17'yi aç: sleep(5)
GPIO.output(18, 0) robot.left()
time.sleep(1) sleep(1)
GPIO.output(17, 1); robot.backward()
#5 saniye bekle sleep(5)
time.sleep(5); robot.right()
#Şimdi de diğer yöne doğrı sleep(1)
GPIO.output(17, 0) robot.stop()
time.sleep(1); sleep(1)
GPIO.output(18, 1); ```
time.sleep(5);
#Döngüde burası başa dönecek [GPIO Zero docs](http://gpiozero.readthedocs.io/en/v1.3.1/api_boards.html#ryanteck-mcb-robot)
#Son olarak GPIO'ları temizleme
GPIO.cleanup()
```