Dancing robot PC design

Through the hardware and software parts of the small π robot introduced in the previous two weeks, can you create a small π robot that can already move? This week, Xiaobian will mainly introduce the upper computer part of the small π robot, so that you can control your own freely. Small π. The upper computer part of the small π robot is divided into the PC software on the computer side and the APP on the mobile phone side.

First, mobile APP

1. Introduction to appinventor

App Inventor was originally a sub-project of Google Labs, and was designed by a group of Google engineers and courageous Google users. Google App Inventor is a fully online Android programming environment that abandons complex code and uses the building block stacking method to complete the developer's Android program. In addition, it officially supports the LEGO NXT robot, which is a great boon for Android beginners or robot developers. Because for users who want to control the robot with their mobile phones, they don't need too much interface, just use basic components such as buttons, text input and output.

2, mobile APP development

The mobile app part mainly includes three parts: real-time remote control, gravity remote control, and motion recording. The real-time remote control function presses an action, and a small π completes an action. It can realize more complicated actions such as shaking the head, lifting the foot, shaking the leg, bouncing, etc. For example, the gravity remote control function mainly uses the gravity sensing module of the mobile phone, and can control the simple movements of the small π forward, left turn, right turn, and back. The action recording function enables the recording of a set of actions. You can achieve functions such as dancing, and you can freely expand to achieve unexpected results.

The APP we made is an APP for operating a small π to implement a series of actions. The following is the APP operation interface that has been created.

In Figure 1, 2, and 3, the button is button, the prompt (such as "change background color:" in Figure 2) is label, the text input box is textbox, etc. When the button is clicked, the corresponding event is triggered, and the corresponding code is executed. For example, when the button "before" is clicked, the phone will send commands to the microcontroller via Bluetooth.

Figure 1 Gravity sensing interface

Figure 2 control interface

Figure 3 Editing the dance step interface

The user can issue different motion commands (such as motion direction, motion shape, etc.) to complete the motion control of the robot. And you can complete more complex control by issuing other commands (such as background color, music playback). Figure 3 shows the design dance interface, where users can design their own dance moves. We also set up 3 sets of fixed actions for the user to call.

3, internal implementation

The basic format of the communication protocol is .

When the APP detects that the forward button has been pressed, the APP sends an instruction to the small π robot through the Bluetooth of the mobile phone. The meaning of this instruction is to take one step forward. Other action instructions are similar.

In the gravity sensing mode, the mobile phone obtains the current posture information of the mobile phone through the built-in acceleration sensor and the gyroscope, and transmits the left and right motion commands by judging the posture information.

The light color selection command consists of three instructions, respectively, and . The parameters of R, G, and B vary from 0 to 255, which can change more than 16 million colors. For example, sending a red command is.

When the mobile APP receives information such as ultrasonic distance, temperature and humidity, the received information is displayed on the APP interface.

The following figure is a screenshot of the core code for establishing a connection between the mobile APP and the HC-06 Bluetooth module for your reference.

Figure 4 APP core code

Second, the computer host computer development

1, C# Introduction

C# is an object-oriented, high-level programming language that runs on the .NET Framework. C# enables C++ programmers to develop programs efficiently, and because native native functions written in C/C++ can be called, the inherent power of C/C++ is never lost. Because of this inheritance relationship, C# and C/C++ have great similarities, and developers familiar with similar languages ​​can quickly turn to C#.

2, computer-side serial port debugging assistant

The serial port debugging assistant is written in C#, and the interface is as shown below. Set the corresponding parameters of the serial port through “Serial Port Settings”. “Serial Port Detection” can be used to detect the serial port available to the computer. “Send Data” can send the data in the “Data Send” column through the serial port. Once the serial port receives the data, it will be displayed in the “Data Reception” column, displayed by characters or “hexadecimal” by the “character display” or “HEX display” previously set. Clear Data clears all data in the Data Receive column and in the Receipt Delivery column. The small π robot can be debugged by sending a related command through the serial port debugging assistant.

Figure 5 computer host computer interface

The program flow of the serial debugging assistant is roughly to start the serial port initialization, and set the serial port number, baud rate, parity, data bit, stop bit, etc. during the serial port initialization process. The command can be sent and received after the initialization is completed. The baud rate of the small π robot is 115200, there is no parity, the data bit is 8 bits, and the stop bit is 1 bit.

3, tablet end PC development

Win10 IoT is a Win10-based IoT operating system developed by Microsoft. The tablet terminal program of the small π robot can be directly run in a tablet equipped with the win10 IoT system. The tablet end program function is similar to the mobile APP program, and the small π robot can be controlled correspondingly via Bluetooth. The program is written in C#, and the program interface is shown below.

Figure 6 Tablet PC interface

Wine Cooler

Wine Cooler

Copper Evaporator is made of copper tube and aluminum fin, also can be copper fin. Copper tube evaporator widely use in various refrigeration unit. Like refrigerator , showcase, cooler, air conditioner, cold room , water dispenser...The function of the copper evaporator is evaporating the heating of the refrigeration unit. With auto welding machine, can assure fast delivery and 0 percent leakage.

Wine Cooler,Cold Room Condenser Unit,Freezer Room Condensing Unit,Refrigerator Condenser Coils

FOSHAN SHUNDE JUNSHENG ELECTRICAL APPLIANCES CO.,LTD. , https://www.junshengcondenser.com