Sunday, January 15, 2017

WeDo & Scratch: Goal Kicker

Long time no post about programming! We will be describing and comparing techniques using the WeDo software and Scratch. And what better approach than comparing the programming of  the Goal Kicker for today.

Tiempo sin escribir sobre programación! Estaremos describiendo y comparando técnicas usando el programa de WeDo y el de Scratch, y que mejor forma que compara la programación del Tirador de fútbol el día de hoy.
The WeDo program begins with the play button to turn the motor on counter clockwise, but just for a short time (only 0.2 seconds or 2 in WeDo, 10 corresponds to 1 second). This is enough to send the ball to the goal against the other team.


The code in Scratch is quite similar. You need to use the equivalent of the play button (“when the flag is clicked”) under the Control Menu. You also need the motor commands under the Motion menu, “Motor direction this way” and “motor on for __ seconds” with the time as 0.2 seconds.



El programa inicial con el software del WeDo consiste en pulsar el bloque de iniciar (el triángulo verde), esto hace que el motor gire en sentido contrario a las manecillas del reloj, pero solo por un instante (el 2 equivale a 2 décimas de segundo o 0.2 segundos). Esto es lo suficiente para poder enviar ese balón frente al arco de la portería del equipo contrario.


En Scratch se puede programar de forma similar. Al utilizar la opción de “al presionar bandera” bajo el menú de Control. Luego es necesario ir al menú de Movimiento, seleccionar el bloque de motor en este sentido, seleccionar el bloque de “motor encendido por __ segundos”, y escribir 0.2 dentro de la casilla de tiempo.


It wasn’t difficult, isn’t it? It can be more interesting later on. For instance, why not using the distance sensor to detect when the ball is in front of the robotic leg. That way the robot can shot straight ahead to the goal line.

This can be done in the WeDo software with the waiting block (the hourglass icon) attached to the distance sensor (the one with eyes) so when the ball is in front, the robot will kick it (see image).



No ha estado difícil, pero puede ser mucho más
interesante. ¿Por qué no usar el sensor de distancia para que cuando detecte el balón frente al pie robótico este procedar dar el golpe de gracia?

En el software del WeDo esto se logra colocando el bloque de esperar (el del reloj de arena) y añadir que espere a que el sensor de distancia (ese que tiene ojos) detecte el balón cerca para proceder a ese disparo contra la portería



In order to do the same code in Scratch, you need to know where to look for the commands since they are kind of hidden. You need to use the “wait until” block (the hourglass equivalent) under the Control menu. We know the distance sensor is required, but we need another block first. Scratch will not allow us to connect this command until we add a comparison block from the Operators menu (the light green commands). On that menu, there is the “_<_” (less than) code. Under the sensors menu, close to the bottom is the “__ sensor value”. From the drop down menu you need to choose distance and you also need to write 2 on the right empty cell.


Enjoy, subscribe and

Para realizar el mismo programa en Scratch hay que buscar un poquillo más. En el menú de control hay que buscar el comando “esperar hasta que” (el equivalente del reloj de arena), sabemos que tenemos que incluir el bloque del sensor de distancia, pero es necesario programar otro bloque primero. Scratch no nos permitirá colocarlo a menos que coloquemos
primero un bloque del menú de Operadores de
compración (los de color verde claro). Allí es necesario buscar el bloque “_<_” (menor que), y luego bajo el menú de Sensores, buscar cerca del final el que dice “valor del sensor”, en el menú desplegable seleccionar distancia, y para terminar la comparación colocar 2 del lado derecho.

Disfruta, suscríbete y




1 comment:

  1. Nice article.Writing best essays gives a brilliant chance to enhance your written work abilities. This incorporates spelling, syntax, and accentuation. Like enhancing sentence structure, figuring out how to compose legitimately will help you actually convey accurately, also. This will turn out to be to a great degree important once you enter the expert world.

    Regards,
    Best essay writing service

    ReplyDelete