Changed the program of the eight methods of the turtle to an embedded chip

Based on my interest, after completing the program development of the Linggui Bafa desktop in my spare time, I feel that the actual application is still not easy. Real acupuncturists will not check the acupoints on their mobile phones during treatment. The more reliable way is to make an embedded product, just like a desk calendar clock, and just glance at it when giving the needle.

According to this idea, just do it, research the technical framework, and a friend recommended nanoframework, which is an embedded framework packaged in .NET, which is suitable for my technical route. The chip is currently cheap, powerful and popular ESP32, which happens to be supported by nanoframework.

After buying the chip, I started to do it, but found that embedded development is very different from desktop development. First of all, the first problem I faced was the wiring between the development board chip and the OLED screen. The first OLED I bought had a lot of SPI protocol lines and I couldn't get it right. Later, it was replaced with an IIC protocol OLED (a total of 4 wires) to successfully light up the screen.

Another problem is transplanting programs. I found that there are many classes and methods written in the .NET CORE architecture. Embedded is not supported, especially the Chinese calendar for calculating the celestial stems and earthly branches. I began to try to transplant the methods used in the bottom layer. , For example, I found the source code of the method used in the Chinese calendar, but found that many methods are one set of one, so this method was abandoned. Then I thought of a way to obtain the final calculation results through the network. The embedded only does display, but this involves the need for a chip to connect to the network. I hope it is a local stand-alone machine that does not rely on the network, so the operation is simpler and more stable, so This method has not been tried. The last method I came up with was to calculate the results of the acupuncture points at 12 hours a day through the previous desktop program, output the results to a txt file for storage, and finally copy them to the chip storage. However, the difficulty encountered in this method is that the chip capacity is only 4m, so the Chinese characters on the acupoints of the output results are replaced by the numbers in the middle of the calculation results, and then part of the calculation logic is written in the chip program, and finally the acupoint results can be output correctly.

The last problem I encountered was the most common system time, which cannot be obtained by default in the embedded system. I bought a separate RTC time memory and added related codes to get the time. But there may be a problem that once the battery is out of power, the time stored in the chip will become invalid, making it unusable.

The work to be done later is to design a shell through 3Dmax, then solder the circuit to the chip, and finally carry out an assembly, and then the basic prototype comes out.

Guess you like

Origin blog.csdn.net/suixufeng/article/details/129749501