Modifications

Sauter à la navigation Sauter à la recherche
631 octets ajoutés ,  15 août 2016 à 21:11
Ligne 23 : Ligne 23 :  
=== Marche avant/arrière ===
 
=== Marche avant/arrière ===
 
[[Fichier:RB-2-WHEEL-MOVE-00.jpg|480px]]
 
[[Fichier:RB-2-WHEEL-MOVE-00.jpg|480px]]
 +
 +
Nous allons maintenant utiliser la classe {{fname|Robot2Wheel}} pour contrôler le Robot deux roues avec {{underline|les raccordements mentionnés dans ce tutoriel}}, les broches à utiliser étant déjà mentionnées dans la classe.
 +
 +
Allons y:
 +
<syntaxhighlight lang="python">
 +
from r2wheel import Robot2Wheel
 +
r2 = Robot2Wheel()
 +
r2.forward( 80 )
 +
r2.halt()
 +
</syntaxhighlight>
 +
 +
Dans cet exemple, nous avons demandé à la plateforme d'avancer à la vitesse de 80% avec {{fname|r2.forward(80)}} .
 +
 +
Vous l'aurez compris, pour passer la marche arrière, il suffit de...
 +
 +
<syntaxhighlight lang="python">
 +
r2.backward()
 +
</syntaxhighlight>
    
=== Tourner à droite ===
 
=== Tourner à droite ===
29 917

modifications

Menu de navigation