The beginners kids once again used the RV2 robot but added a Colour sensor. We then used the Colour sensor to follow a line on the floor. The line follower program is a staple of lego robotics classes and there are highly complicated versions that are more efficient than this version. We will explore those versions in future classes.
This is the basic line following code.
This is the result.
The advanced kids built a projectile launcher robot. This was programmed to shoot a projectile at a certain velocity depending on how far away the robot was. This is the code. There is a lot going on in this. Basically I recorded a bunch of data and then took that data and fitted it to a curve in Excel and then used the resulting equation to produce the following code. It’s cool.