• sales

    +86-0755-88291180

Chapter 6 of KitiBot-Microbit: Running, KitiBot User Guide

Running, KitiBot

In the previous chapters we have learned how to control LED lights and buzzers. As we might presume, you will be eager to know how to control the car and make it move. In this chapter we'll learn how to do so!

Create a new project, click "Advance->Add Packages and input address: https://github.com/waveshare/pxt-KitiBot to add KitiBot software libraries. After adding, a KitiBot and APA102 classes will be added in blocks area


There are two motors on both sides of KitiBot, M1 and M2. This motor can control wheel to move forward or backward, control wheel's speed. With these motors, we could control KitiBot's movement.


Control motors


This block set motor speed, being range value from 0 to 255. 255 stands for faster wheel spin. -255 value represents the reversed wheel rotation (moving backwards) and 0 means stop


We make a simply program to control motors by A/B buttons.


M1 motor is rolling when A is pressed until button is released. When B is pressed, M2 motor is rolling until button released. If you press A and B at the same time, both M1 and M2 are rolling.

Motion


When you run this program, KitiBot will move forward, backward, turn left, right and stop.

From the codes, we could know:

If both two motors move forward, the KitiBot will move forward;

If bot two motors move backward, the KitiBot will move backward;

If right motor moves forward and the left one stops or backwards, the KitiBot will turn left;

If left motor moves forward and the right one stops or backwards, the KitiBot will turn right;

If both motor stop, the KitiBot will stop.

Motion Block


This block can be used to control motion of KitiBot directly


Motion Block 2


This block is used to control Kitibot to move for some times, it has more a time parameter than the last one


TAG: Desktop Trinket Raspberry Pi LCD Display Screen 1.3inch LCD with Game Button AND Audio Buzzer For Zero 2W / 3B / 4B / PI5 / RP2040-PiZero Electronic EYE 0.71inch Round LCD Display Screen For Arduino Raspberry Pi ESP32 Pico STM32 DeepSeek AI Voice Chat ESP32 S3 Development Board 2.06-inch AMOLED Display 410×502 2.06inch TouchScreen Programmable Watch Raspberry Pi 5 Serial Jetson Orin 5G/4G/3G expansion board GNSS GPS SIM8260G-M2 SIM8262E-M2 RS232 to RS485 Raspberry Pi Zero 4G Cat1 With USB Hub Expansion Board LTE/GPS/EA/EU also For Zero 2W Raspberry Pi 5 Camera Raspberry Pi 10.1 inch LCD HDM Display Capacitive TouchScreen 10.1EP-CAPLCD 1920x1200 For Jetson Nano/mini Computer PC USB Camera 2MP GC2093 ‌WDR Backlight Compensation‌ Onboard microphone Raspberry Pi CM5 Mini Base IO Board NANO A Development For Compute Module 5 BG95-M3-Zero QuecPython EVB development support LTE/EGPRS and GNSS ESP32-S3 0.85inch LCD NVIDIA Jetson Orin Nano 4/8GB AI 20/40Tops Lower Power Autonomous Machines Gyroscope Raspberry Pi Pico 2 RP2350B 2.1 inch Round LCD Touch Display 480x480 HMI LVGL QMI8658 6-axis 65K Colors LCD Screen Driver Board LuckFox Pico User Guide ESP32-S3 USB Dongle