Program for the EV3 tug of war with touch sensors

This is an example program for tug of war with two touch sensors. The game can be played with almost any robot, so we used: https://www.fllcasts.com/materials/265-five-minute-bot, because it is the simplest. You have to attach two touch sensors at ports 1 and 4, preferably with long cables. You can also add a color sensor to port 3, which will detect when to end the game, although this is not required. The game is simple, two human players click the touch sensors as fast as they can. The robot moves in the direction of the one that clicks the fastest and the goal is to bring it to your finish line.

The program teaches about counters and flags. A big part of it is the good names of variables and loops and the addition to plenty of comments, from which students can learn how to form their program.

Download
  • #7iyau9
  • 21 Nov 2019

Courses and lessons with this Program

This Program is used in the following courses and lessons

Image for Robotics with LEGO - Level 4.5 Game Time
Course icon fllcasts
  • 5
  • 1:03
  • 31