Ejemplo n.º 1
0
#         robot.pixel(200,100,200) # muestra de color
#     while cm <=20:  # mientras este a menos de 20 que avance
#         robot.move_forward# avanzamos
#         cm= robot.see()   # volvemos a verificar que distancia estamos (es un ciclo )
#         print(cm ,"atacamos")

#     robot.mov(50,50)
# except KeyboardInterrupt:
#     print ("finalizado")
#     robot.move_stop

#sensor
import rodi
import time

robot = rodi.RoDI()

# while True:
#     print (robot.light())  # sensor de luz de rodi la cantidad de luz que detecta
#     time.sleep(0.5)

robot.sing(800, 10000)

####################################)
while True:
    linea = robot.sense()
    print(linea)
    print(linea[0])
    print(linea[1])
    time.sleep(0.5)
Ejemplo n.º 2
0
import rodi #importamos el codigo del bot
import time #importamos el codigo time

robot = rodi.RoDI() #se guarda tody 

# robot.move_forward() #mueve hacia adelante
# time.sleep(1)       #queda haciendo lo anterior por un segundo.
# robot.move_left()   #hace un giro a la izquierda
# time.sleep(0.5)     #queda haciendo el giro por 0.5 segundos
# robot.move_right()   #hace un giro a la derecha
# time.sleep(2)       #queda girando a la derecha por 2 segundos
# robot.move_backward()   #mueve el robot hacia atras
# robot.move_stop()   #para el robot.

# for x in range(1,5):
#     robot.move_forward()
#     time.sleep(2)
#     robot.move_left()
#     time.sleep(0.5)
#     robot.move_stop()
#     robot.pixel(255,0,255)

# try: #intentar esto
#     ver= 3
#     while int(ver) == 3:
#         print(robot.see(), "centimetros")
#         if (robot.see()) <= 20:
#             print(robot.see(), "centimetros")
#             robot.pixel(255,0,0)
#             robot.move_left()
#             robot.move_stop()
Ejemplo n.º 3
0
import rodi  #para importar los comandos a utilizar
import time

robot = rodi.RoDI()  # instanciamos y creamos el objeto robot
'''
robot.move_forward() #mueve hacia adelante
time.sleep(1)         # queda haciendo lo anterior por 1 segundo     
robot.move_left()     # hace un giro a la izquierda
time.sleep(1)         # queda haciendo el movimiento a la izquierda por 1 segundo
robot.move_right()    # GIRO A LA DERECHA




#ejer1. hacer un cuadrado
robot.move_forward()
time.sleep(1)
robot.move_stop()
time.sleep(0.5)
robot.move_right
time.sleep(0.5)time.sleep(1)
robot.move_stop()
time.sleep(0.5)
robot.move_right
time.sleep(0.5)time.sleep(1)
robot.move_stop()
time.sleep(0.5)
robot.move_right
time.sleep(0.5)time.sleep(1)
robot.move_stop()
time.sleep(0.5)
Ejemplo n.º 4
0
import rodi
import time

robot = rodi.RoDI()  #instanciamos un objeto RoDI

while True:
    linea = robot.light()  #leemos e imprimimos la lectura del sensor de luz
    time.sleep(0.5)
    print(linea)
Ejemplo n.º 5
0
import rodi
import time

arduin = rodi.RoDI()
# arduin.move_backward()
# time.sleep(2)
# arduin.move_left()
# time.sleep(0,2)
# arduin.move_stop()
# time.sleep(1)

# arduin=rodi.RoDI()
# arduin.move_forward()
# time.sleep(1,5)

# arduin.move_right()
# time.sleep(0,35)

# arduin.move_forward()
# time.sleep(1,5)

# arduin.move_right()
# time.sleep(1,5)

# arduin.move_stop()
#pasare=1
# distancia= 1
# while ditancia in == 1:
# for pasare range(1,3):
#     arduin.move_forward
#     time.sleep(0,25)