Contents Preface ................................3 Chapter 1 Product Introduction ........................ 4 I. MC101 Controller .......................... 4 II. Actuator and Sensor ........................5 Chapter 2 Software Introduction ......................7 I. Software Download and Installation ....................7 II. Connection Controller and Downloader ..................7 III.
The book introduces the way to use AI Module 1 series building block robots and WhalesBot Scratch software. Simple programming examples are given to help users learn to use AI Module 1 series along with its software better and faster. After you get this product, please read the manual carefully.
Chapter 1 Product Introduction I. MC101 Controller MC101 controller is the latest generation. It is small but stable and reliable, also it has large program storage capacity and rich interface, famous of being high performance but low power consumption. MC101 controller has such universal interfaces as I/O, I^2C and URART at the top, motor interface and MiniUSB interface at the bottom, buttons and speakers at the front and battery compartment at the back.
MC101 controller firmware upgrade The main program running in the firmware MC101. Without firmware, the MC101 controller will not be able to work. Sometimes new firmware versions are released to enhance functionality or fix software defects. Make sure using WhalesBot Scratch software to connect your computer to MC101 controller with a USB cable to update firmware.
Page 6
closed-loop modes, which allows to accurately control rotation speed and rotating cycles ultimately driving the robot to complete various tasks. It uses the dot-matrix LED Emotional display technology, array-expressio screen variety built-in robot expressions and over 50 kinds of symbols and is applicable to array-symbol a number of scenarios, greatly enhancing...
Chapter 2 Software Introduction I. Software Download and Installation Please download WhalesBot Scratch software Standard Version, Setup.exe, from the official website www.gopuratech.com . Follow the steps to complete installation. II. Connection Controller and Downloader Please make sure that the controller is fully charged, computer and controller is also connected with USB cable when you connect with WhalesBot Scratch software.
III. Flow Chart Programming 1、Introduction of flow chart interface Module bar Software information Menu bar Programediting terface Code display area The flow chart program editing window is shown in the figure above. The left is the module library, the middle is the program editing window, and the right is the C or Python code bar that controls display function and content.
2、Module instructions Firstly define program function, then detect corresponding module, drag it to the lower part of the main program and connect after blue bar prompt pops up, left click the module to select parameters in the pop-up interface, download the program to the controller, run the program and achieve the function.
Page 10
Set the Motor Control motor rotation, motor ports with the power range of -100~100 (which can also be controlled through variables). The advanced module can control the time or movement distance of the motor (1600 means that the motor rotates about 360°). Turn off the Motor The motor of...
Page 11
Reading Convert settings and ports sensor states to values and sound them through loudspeaker. ports 3.2 Sensor module library The sensor module library contains all modules that can be used to collect external environmental data, and the physical access of corresponding sensor can assign the data collected to corresponding variable.
Page 12
variable. Infrare Assign the ports detection value of ranging infrared sensor at corresponding port to the infrared ranging variable. Touch Assign the switch ports detection value of touch switch sensor at corresponding port to the switch variable. Magnet Assign the ports detection value of sensitiv...
Page 13
if...else...statement and for statement, which are in the control module library. Module Module diagram Interpretation name Conditional With regard to if (condition)...else statement in C judgment Language, user can control the conditions by setting variables, sensors and parameters. If conditions are met, execute upper statement, otherwise execute the lower statement.
Page 14
Module Module diagram Interpretation name New task Add a process to user program, which is equivalent to the fact that the controller do multiple tasks simultaneously, and these tasks are executed in parallel. Package the programs of multiple modules into one function module to reduce the length of the main program.
Page 15
Assign the results of the equal to Comparis comparison operation of the on-equal parameters filled in or referenced by the user to integer variable or other variables. Assign the results of the not equal to Comparis comparison operation of the on-not parameters filled in or referenced by equal to...
Page 16
correspond to any actuator object. 3.6 Variable module library Variable is one of the two representations of data. Variable represents a named storage unit with specific attributes, which is used to store data. For example, the detection value of the ground grayscale sensor is assigned to the grayscale variable. Module Module diagram Interpretation...
IV. Introduction of C Language and Python Editing Interface Under the flow chart editing interface, click “Switch to C code editing” in the code conversion interface as shown in the figure. Under the flow chart editing interface, click “Switch to Python code editing” in the code conversion interface as shown in the figure.
C Language editing interface is as shown in the figure above, mainly including 4 windows: Menu bar, function and variable display, program editing and multi-function prompt window. The program editing window is the larger one at upper right corner. II Introduction of Python Language interface Program Menu bar Multi-function...
Chapter 4 Programming Example I Control Motor Stop and Rotation by Touching the Sensor Connect touch sensor and motor to controller, use conditional loop to control motor stop and rotation, and need to use motor, touch sensor, repetitive execution, judgment, operation-less than, motor stop and cyclic interrupt module, and the program is as shown in the figure above.
II Infrared Sensor Detection Connect infrared sensor and motor to controller, use conditional loop to reverse the motor for 2s and then stop the motor, and need to use motor, infrared sensor, repetitive execution, judgment, operation-less than, reverse motor, wait, motor stop and cyclic interrupt module, and the program is as shown in the figure above.
Chapter 5 Introduction to Line Patrol The line patrol module library is a specific module library developed for line patrol robot competition. This module library uses the PID algorithm to enable the robot to accurately patrol, locate intersections and make precise turns, which can meet the needs of most line patrol competitions.
Page 22
channels 1-5 of the integrated grayscale sensor from left to right, respectively. 2. Black and white detection: Calibrate the black lines and white background on the site. Module interpretation: Constitute a complete program with the initialization module and download it to the controller, and it is necessary to conduct black and white detection if the site or ambient light is changed.
Page 23
Time of passing through the intersection: It refers to the time for the grayscale sensor of the trolley to continue to advance after passing through corresponding intersection (black lines); the length of the time of passing through the intersection directly affects its position relationship with black lines after the trolley turns. 4.
Page 24
Distance control: The left and right wheels of the trolley move at a certain speed for a certain period of time (The displacement distance shall be subject to the motor wheel with faster speed). 8. Starter motor-sensor control: Control motor operation based on sensor to make the trolley displace. Module interpretation: It is mostly used for the displacement of the trolley in the area without black lines;...
Chapter 6 Epilogue I Maintenance 1. In case of low battery during use, please replace the battery in time, so as not to affect use. 2. If the controller is not used for a long time, please take the battery out. 3.
Need help?
Do you have a question about the AI Module 1 and is the answer not in the manual?
Questions and answers