• 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 5 Night Camera Raspberry Pi Camera Jetson RTL8822CE 5GHz WiFi Wireless Bluetooth5 Card NGFF-M.2 RTL8822CE-CG Core Raspberry Pi 14 inch LCD 2K HDMI /Type C Display Capacitive TouchScreen 2160x1440 For Jetson Nano/mini Computer PC Jetson Raspberry Pi 5 Official Original PCIe to M.2 NVMe SSD Raspberry Pi M.2 HAT+ Board For Pi5 Package Kit Raspberry Pi CM4S08032 And Compute Module PoE IO Board Raspberry Pi 5 Raspberry Pi Pico W Omni-Directional Lidar RS232 to Ethernet X1201 Raspberry Pi 5 UPS Board Uninterruptible Power Supply For 18650-Li-Battery (NOT includ) Raspberry Pi CM5 Mini Base IO Board NANO A Development For Compute Module 5 Gripper Serial Robotic Arm Gripper Mechanical claw Serial Bus Servo ST3215/CF35-12 Raspberry Pi CM5 IO BASE B Mini Board a Base Development Platform Compute Module 5 IO Board with EEPROM And Encryption chip USB-CAN-B LuckFox Pico Raspberry Pi 5 PCIe to M.2 NVME SSD And Gigabit Ethernet RJ45 HAT RTL8111H M_KEY For 2230/2242/2260/2280 Raspberry Pi 13.3 inch FHD Monitor LCD 1080P Capacitive TouchScreen Display Type-C/HDMI For Computer PC ESP32-P4 Smart 86 TV Box Development Board 4 inch 720x720 Display TouchScreen RS485 Relay Camera RJ45 ETH