Give the gift of coding this Christmas and sparks a child's coding journey! 😃🎮💻 Get a gift card
Microbit Inventor Project Robotics Sensors & Circuits
Normal
40 mins
140 points
What you need:
  • Computer/laptop
  • Microbit
  • Move Motor Sensor Car
  • AA Batteries
  • USB Cable
  • Move Motor Klaw

Robot Car Claw

In this project we will learn how to program and use the Move Motor Klaw.

1 - Setup

Before you start this project you will need to have a Move Motor Car with a Move Motor Klaw attached and a Microbit inserted into it.


2 - Create a new project

Go to the https://makecode.microbit.org/ website and create a new Microbit project.

3 - Add the extension

Add the kitronik-move-motor extension to your project.


4 - How servos work

The Move Motor Klaw has a servo in it that we can program and this controls the 2 pinchers of the claw.

What is a servo?
A servo is a small device that has an output shaft. This shaft can be positioned to specific angular positions by sending the servo a coded signal. As the coded signal changes, the angular position of the shaft changes. In practice, servos are used in radio controlled airplanes to position control surfaces like the elevators and rudders. They are also used in radio controlled cars, puppets, and of course, robots.


5 - Close the claw

First let's program the claw to close. To do this we will use the write servo [1 v] to 0 block which sends the a value to the servo and the servo uses this value to set what angle to turn the shaft to.

Sending a value of 0 should make the claw close. Add the following code to your project to close the claw when you press the A button.

Once you've added the code, download it onto your Move Motor Car, turn the car on and press the A button to test that it closes correctly.

Note that the Move Motor car has two servo connections. They are labelled on the car as "SERVO 1" and "SERVO 2". When you are adding the above code make sure you choose whatever servo (1 or 2) that you have connected your claw to on the car.

Join our club 😃

To view the remaining 5 steps and access hundreds of other coding projects please login or create an account.

Copyright Notice
This lesson is copyright of Coding Ireland. Unauthorised use, copying or distribution is not allowed.
🍪 Our website uses cookies to make your browsing experience better. By using our website you agree to our use of cookies. Learn more