1.Teaching objectives (knowledge preparation)
Understand the specifications and parameters of electric motors.
By programming the motor, the direction and speed of the motor can be controlled.
Can be combined with real-life application scenarios and project devices. Simple automation of daily life scenarios can be achieved through the use of controllers and drivers.
2.Teaching tasks
Build a handheld automatic wiping machine. Start the switch to enable the motor to rotate according to demand and achieve wiping function.
3.Preparation of teaching environment and equipment
Equipment List: Image (with label number 123456)
Equipment Serial Number Table
| Serial number | number | equipment | Specifications | quantity |
| 1 | Motor | 1 | ||
| 2 | Switch | 1 | ||
Software: Smart Code programming software.
Hardware: SMART Code kit: Switch、Motor.
Other: A cloth or wet tissue.
Detailed List of Structural Components
| Serial number | number | equipment | Specifications | quantity |
| 1 | 3-hole beam | 12 | ||
| 2 | 7-hole beam | 4 | ||
| 3 | 13-hole beam | 4 | ||
| 4 | T-shaped beam | 4 | ||
| 5 | Black sales | 36 |
Note: Materials required to fix a set of sensors: 6 3-hole beams, 2 7-hole beams, 2 13 hole beams, 2 T-shaped beams, and 18 black pins.
4.Project Practice Process
(Summary of Knowledge Points: 1. Components. 2. Program Modules. 3. Program Design)
1.Project video (in video format)
2.Project Steps
Assemble an automatic glass cleaning machine, including a driver and a mechanical body. Reasonably determine the size and dimensions of the motor rotating equipment based on the wiping area.
Preliminary suggestion is to use a handheld device for the automatic wiping machine, and to build and fix the handle.
Use SMART Code to program and control devices.
Firstly, complete the switch sensor logic. When the switch is pressed and not pressed, there are two states. The example code is as follows:
Then, control the motor rotation according to the switch, and the motor speed value can be adjusted according to the actual situation. The example code is as follows:
Finally, to ensure that the program runs continuously, the above code needs to be placed in a loop. The example code is as follows:

3.Test the frequency and effectiveness of wiping.
4.Optimization and improvement plan.
5.Interesting thinking: How to improve wiping efficiency. Under the same environment, the efficiency of wiping during the competition.
3.Reflection and discussion: How to increase the wiping pressure under the premise of determining the motor speed?
Experimental results
Data records: Table 1 and Table 2
Experimental conclusion:
5.Extension and Expansion
Reflection and exploration:
Question 1:
Question 2:
