Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/nxt_plugin/prueba1.py
diff options
context:
space:
mode:
Diffstat (limited to 'nxt_plugin/prueba1.py')
-rw-r--r--nxt_plugin/prueba1.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/nxt_plugin/prueba1.py b/nxt_plugin/prueba1.py
new file mode 100644
index 0000000..9e8ea34
--- /dev/null
+++ b/nxt_plugin/prueba1.py
@@ -0,0 +1,15 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+# importamos las funciones de la API
+import nxt.locator
+from nxt.motor import *
+
+# esta función trata de conectarse al brick
+b = nxt.locator.find_one_brick()
+
+# movemos el motor conectado en el puerto B del brick b
+motor_izquierdo = Motor(b, PORT_B)
+
+# con potencia 100 y que de una vuelta completa (360º)
+motor_izquierdo.turn(100, 360)