Musica añadida al igual que velocidad de los cojones. Falta probar velocidad, girov2, giro y recta

parent cf5daad6
No preview for this file type
No preview for this file type
...@@ -13,6 +13,7 @@ class Robot: ...@@ -13,6 +13,7 @@ class Robot:
valorW = 30 valorW = 30
w = 0 w = 0
velocidad = 50 velocidad = 50
velocidadNegro = 50
negroFlag = False negroFlag = False
radiusCurve = 20 radiusCurve = 20
...@@ -124,10 +125,14 @@ class Robot: ...@@ -124,10 +125,14 @@ class Robot:
if self.is_black(rgb): if self.is_black(rgb):
self.negroFlag = True self.negroFlag = True
while (((self.queNegroEs(contNegroAnterior) == 1) and (self.queNegroEs(self.contadorNegros) == 0)) == False) or self.contadorNegros == 0: while (((self.queNegroEs(contNegroAnterior) == 1) and (self.queNegroEs(self.contadorNegros) == 0)) == False) or self.contadorNegros == 0:
#Fase de lectura #Fase de lectura
rgb = self.colorSensor.rgb() rgb = self.colorSensor.rgb()
#Fase de control
if self.is_green(rgb): if self.is_green(rgb):
self.w = self.valorW self.w = self.valorW
self.velocidad = Robot.velocidad
negroAnteriorFlag= self.negroFlag negroAnteriorFlag= self.negroFlag
self.negroFlag = False self.negroFlag = False
...@@ -135,10 +140,12 @@ class Robot: ...@@ -135,10 +140,12 @@ class Robot:
negroAnteriorFlag = self.negroFlag negroAnteriorFlag = self.negroFlag
self.negroFlag = True self.negroFlag = True
self.w = 0 self.w = 0
self.velocidad = self.velocidadNegro
else: else:
negroAnteriorFlag= self.negroFlag negroAnteriorFlag= self.negroFlag
self.negroFlag = False self.negroFlag = False
self.w = -self.valorW self.w = -self.valorW
self.velocidad = Robot.velocidad
#Fase de ejecución #Fase de ejecución
#Incremento negro al entrar #Incremento negro al entrar
...@@ -163,3 +170,14 @@ class Robot: ...@@ -163,3 +170,14 @@ class Robot:
while self.colaMovimientos.not_empty(): while self.colaMovimientos.not_empty():
movimientoAct = self.colaMovimientos.get() movimientoAct = self.colaMovimientos.get()
#Aqui faltan los if correspondientes a cada tipo de movimiento #Aqui faltan los if correspondientes a cada tipo de movimiento
#Extras totalmente innecesarios
def tono(self,cancion):
if cancion == "vic":
self.ev3.speaker.play_file("media/sound/vic.mp3")
elif cancion == "cubo":
self.ev3.speaker.play_file("media/sound/cubo.mp3")
else:
self.ev3.speaker.beep()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment