• 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: Raspberry Pi Pico 2 RP2350B Industrial 8-Channel Relay IOT LAN Digital Input DIO /RS485 /RJ45 Ethernet /POE Solar Charge Module Raspberry Pi5 PCIe TO M.2 MINI Support Gen2 and Gen3 SSD Compatible 2230 2242 Sipeed Lichee Tang Nano 4K FPGA MINI Development Board W1NSR-LV4C GOAI Gowin spotpear Pi5-Pcie-Fish-Boar Pi5 Active Cooler ESP32 S3 Development Board 1.91 inch AMOLED Display Screen For Arduino LVGL With SD-Port/ QMI8658C 6-Axis Sensor Raspberry Pi 5 inch (B) DSI MIPI LCD TouchScreen Display 5inch 720x1280 For Luckfox Lyra RK3506/ESP32-P4/Luckfox Omni3576 Raspberry Pi Pico 2 RP2350B 2.8 inch LCD Development Board RGB Display Round TouchScreen 480x480 LVGL QMI8658 / SD / RTC ESP32 P4 Development Board 7-inch LCD Display 1024×600 7inch Touchscreen ESP32-C6 WiFi6 AI Deepseek Industrial CAN FD RS232/RS485 bidirectional converter CAN2.0A/B Raspberry Pi 11.6 inch LCD HDMI /Type C Display In-Cell Capacitive TouchScreen 1768x828 For Jetson Nano/mini Computer PC ESP32-S3 AI RGB Matrix Driver Board Dual Microphone DeepSeek Raspberry Pi 0.96inch LCD Raspberry Pi 7.5 inch e-Paper link (H) RYBW 800x480 For Arduino / Jetson Nano / STM32 5inch USB Monitor AI Machine Vision Kit OAK-D-POE JPEG Encoder 12MP IP67 Waterproof 4TOPS OpenCV Camera Raspberry Pi Pico 10.1inch DVI LCD Raspberry Pi PICO LoRa