Program for Larvy - LEGO SPIKE Prime robot

This program makes Larvy - LEGO SPIKE Prime larva robot move forward indefinitely! The movement of this robot is very interesting as it works like a caterpillar or larvae! The program works by repeating 3 movements every cycle of the loop:

  1. the front motor rotates for 90 degrees, rising or collapsing its wheels
  2. the large motor rotates for 90 degrees, contracting or expanding the robot
  3. the back motor rotates for 90 degrees, rising or collapsing its wheels

You may notice that every movement command does two things, or the same thing but a different direction. That is done using a variable that is either 1 or -1, and that gives the direction that the motors should move. This variable is also used to determine which motor should use full power and which shouldn't so that the robot doesn't break itself!

i18n: Download
  • #b4lgwx
  • 21 Jul 2020

Courses and lessons with this Program

This Program is used in the following courses and lessons

Image for Stay @ Home SPIKE Prime Course
  • 4
  • 0:00
  • 22
Image for Lesson 1 - Larva robot
  • 1
  • 2
  • 2
  • 3d_rotation 1