Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Vicente Castellano Gómez
/
robotAmbientales
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
cf5daad6
authored
May 03, 2024
by
Vicente Castellano Gómez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Funcion de girov2 implementada falta probar, eso no funca a la primera ni de coña
parent
9da262fa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
2 deletions
main.py
robot.py
main.py
View file @
cf5daad6
...
...
@@ -14,8 +14,8 @@ robot.sigueRecto()
robot
.
sigueRecto
()
#robot.sigueLineaHastaNegro()
#robot.sigueLineaHastaNegro()
robot
.
gir
o
(
90
)
robot
.
gir
aDerecha
(
)
robot
.
sigueRecto
()
robot
.
gir
o
(
-
90
)
robot
.
gir
aIzquierda
(
)
#robot.calibraSensorColor()
robot.py
View file @
cf5daad6
...
...
@@ -61,6 +61,27 @@ class Robot:
print
(
self
.
colorSensor
.
rgb
())
wait
(
20
)
def
calibraSensorColorReal
(
self
):
self
.
ev3
.
screen
.
print
(
"Presiona el botón para calibrar el color verde"
)
while
not
Button
()
.
any
():
wait
(
10
)
# Medir color verde
green_rgb_medido
=
self
.
colorSensor
.
rgb
()
self
.
ev3
.
screen
.
print
(
"Color verde calibrado:"
,
green_rgb_medido
)
self
.
ev3
.
screen
.
print
(
"Presiona el botón para calibrar el color negro"
)
while
not
Button
()
.
any
():
wait
(
10
)
# Medir color negro
black_rgb_medido
=
self
.
colorSensor
.
rgb
()
self
.
ev3
.
screen
.
print
(
"Color negro calibrado:"
,
black_rgb_medido
)
self
.
green_rgb
=
green_rgb_medido
self
.
black_rgb
=
black_rgb_medido
self
.
ev3
.
screen
.
print
(
"Calibración completa."
)
#Metodos para el movimiento
def
giro
(
self
,
grados
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment