This program makes Swing game - LEGO SPIKE Prime robot move the two people according to the input from the controllers!
The color sensor controller uses the colors on the plate above it to determine how to move the LEGO person. If the color is blue, it moves forward, if its purple, it moves backwards, otherwise - it stops!
The motor controller has a similar program, if it has turned more than 30 degrees forward, the LEGO person moves forward, if it has turned more than 30 degrees backward, the LEGO person moves backward, otherwise - it stops.
The goal of the game is for both LEGO people to reach the center, without the swing tipping to either side! Good luck and have fun!
- 24 Jul 2020