Code Snippet

Change Position

Make Ohbot change its position by a set amount each time a key is pressed.

The Change Position blocks

About this snippet

This snippet changes the position of the head nod and head turn motors by a set amount when an arrow key is pressed. It uses the change block. This changes the position of a motor by a number between 0.1 and 10 in one direction. You can also change by negative numbers between -0.1 and -10 to move in the opposite direction.

Go further

Try several changes at once by using several change blocks in a stack.

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
Change Position — Code Snippet | Ohbot