Code Snippet

Puppet

Repeatedly set a motor to the position of the mouse to turn Ohbot into a puppet.

The Puppet blocks

About this snippet

High on a hill was a lonely robot Ohdeley! This snippet uses loops to repeatedly set the position of the robot's motors to the position value of a sensor. The Mouse X sensor block (on the sensor menu) gives the position of the mouse in the x axis as a number between 0 and 10. The Mouse Y block does the same for the Y axis to make up and down movement.

Download

  1. Click the download button below.
  2. In the Ohbot App, on the File menu select ‘Open Ohbiverse Download’.
  3. Find the downloaded file and click Open.
Download snippet
Puppet — Code Snippet | Ohbot