• 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 LCD 3D Display Raspberry Pi 5 Audio Jack Raspberry Pi Monitor Official Original DisplayScreen 15.6 inch LCD Full HD 1920x1080 15.6inch ESP32 C3 Round LCD Development Board Electronic EYE 0.71 inch Display Watch Screen GC9A01 160x160 ESP32 ESP32 Portable Pendant SpotPear Industrial Modbus POE ETH RJ45 To 8-Ch Relay B RTU/Modbus TCP-Ethernet For IOT ESP32-S3-Zero Raspberry Pi 3 LCD HAT Raspberry Pi 4 Camera Raspberry Pi Pico W ESP32-S3N8R8 7inch LCD Display TouchScreen 800×480 WiFi Bluetooth CAN RS485 Sensor Raspberry Pi PICO ESP32 Thermal imaging camera Raspberry Pi Industrial 10.1 inch DSI LCD HMI TouchScreen MIPI Display 1280x800 10.1inch One-Body PC With Front Camera For Pi 4/5 Raspberry Pi 5 Official Red-White Case Industrial Isolation USB TO RS232/485/422/TTL FT232RNL Serial UART Converter RM520N GL 5G/4G/3G M.2 Moudle IoT EMBB For LTE-A/NSA/SA And GNSS For DFOTA /VoLTE For Quectel EG25-G Mini PCIe SIMCom Original 4G LTE Cat-4 Module Global Coverage GNSS PCI Express Mini Card