What is the connection method between the infrared sensor and the computer, serial port? USB?
What programming language is used to write the receiving program on the computer, C++? C#? (I have only done it on Windows)
I don’t know what you call an infrared sensor. The infrared sensors I have seen are similar to transistors and diodes without any computing power. In this case, you need to connect the infrared sensor to the microcontroller, collect the sensor signal through the microcontroller, and then communicate with the computer through the serial port or USB.
If I did it, I would consider:
Selection of microcontroller
Direct communication protocol between infrared sensor and microcontroller
On the computer side, I usually use C# to write serial communication programs, which is simple and useful
Let me explain to you. There are related controllers and signal conversion units inside the sensor. If the infrared signal is blocked and the status changes, the internal register is worth changing. . This involves the design of the lowest level thing, just like the light signals perceived by your eyes are converted into electrical signals and transmitted to your brain. . Leave it alone. The computer can just read this value, connect to the peripheral, allocate an I/O address, and then call the relevant functions for reading and writing IO. . You can use any language, usually C or C++, it would be better if you understand some microcomputer principles
The infrared receiver will produce level changes as the infrared physical signal changes. For example, it is always high level when there is infrared irradiation, and it is always low level when there is no infrared irradiation. This is a problem at the analog circuit and digital circuit level.
Using a microcontroller, you can connect the pin to the infrared receiver to detect the level change, trigger an external interrupt, and the interrupt service routine is called. You can write the interrupt service routine yourself to handle it, such as forwarding it to other devices. . This is all a matter at the microcontroller level, or it may be a matter of some kind of packaged driver chip.
There are many ways for microcontrollers to forward data. The most common one is to use a serial port to communicate with a computer that supports the serial port (older computers have serial ports).
What is the connection method between the infrared sensor and the computer, serial port? USB?
What programming language is used to write the receiving program on the computer, C++? C#? (I have only done it on Windows)
I don’t know what you call an infrared sensor. The infrared sensors I have seen are similar to transistors and diodes without any computing power. In this case, you need to connect the infrared sensor to the microcontroller, collect the sensor signal through the microcontroller, and then communicate with the computer through the serial port or USB.
If I did it, I would consider:
Selection of microcontroller
Direct communication protocol between infrared sensor and microcontroller
On the computer side, I usually use C# to write serial communication programs, which is simple and useful
Let me explain to you. There are related controllers and signal conversion units inside the sensor. If the infrared signal is blocked and the status changes, the internal register is worth changing. . This involves the design of the lowest level thing, just like the light signals perceived by your eyes are converted into electrical signals and transmitted to your brain. . Leave it alone. The computer can just read this value, connect to the peripheral, allocate an I/O address, and then call the relevant functions for reading and writing IO. . You can use any language, usually C or C++, it would be better if you understand some microcomputer principles
The infrared receiver will produce level changes as the infrared physical signal changes. For example, it is always high level when there is infrared irradiation, and it is always low level when there is no infrared irradiation. This is a problem at the analog circuit and digital circuit level.
Using a microcontroller, you can connect the pin to the infrared receiver to detect the level change, trigger an external interrupt, and the interrupt service routine is called. You can write the interrupt service routine yourself to handle it, such as forwarding it to other devices. . This is all a matter at the microcontroller level, or it may be a matter of some kind of packaged driver chip.
There are many ways for microcontrollers to forward data. The most common one is to use a serial port to communicate with a computer that supports the serial port (older computers have serial ports).