Simple Vehicles || Kennedy Cambra-Cho

The goal of this lab was to get more comfortable with KittenBot and get a better understanding of the available movement.

Uploading hex file to microbit

Materials

1 KittenBot

MakeCode https://makecode.microbit.org/#

Procedure

LED Sequence

Using the basic show icon block we programmed the microbit to illuminate a sequence of images on its face. The pattern is asleep followed by angry. In order to have the image illuminate at a steady pace we added a delay of 100. 

Video #1 – LED sequence + servo sweep 

Servo 

To get the servo to rotate we used the Robotbit servo (not Geek Servo) block. Our servo moves from 0 to 180 with a 50 millisecond delay. 

Motor Sequence

 Our first goal in this section was to get just one DC motor to turn on. Using the makeCode blocks we got the right wheel to move at a speed of 150. 

Video #2 – M1A motor turn 

Initially we tried just using two of the same Motor block but each sending a signal to their respective motors. However, we found that this actually makes the motors move one at a time. To get both motors move simultaneously we needed to use the double motor block. 

Video #3 – forward and backward turn sequence 

By making the speed of both motors positive we found that the wheels will move in opposite directions. Therefore, instead of moving forward the bot would simply rotate in place. To make the bot move forward the speed needs to be positive and negative on the respective motor. 

Video #4 – Both Motors Positive Speed (spin)

Forward: M1A + M2B –

Backward: M1A – M2B +

Video #5 – move forward 

Reflection

Working with the makeCode and DC motors was a lot trickier than I thought it would be. It seems that the motors design is not as intuitive as I would have thought. The issue with sending the signal simultaneously was easy to fix with the blocks but, understanding how the speed and direction were correlated was not as seamless. 

Something I am interested in exploring is the bot’s ability to multi-task. The only way we were able to program both motors to work simultaneously is because there was a pre-made block offered. For actions such as avoiding objects and searching for objects I am unsure how we will tackle these issue. 

Leave a Reply