Home python Arduino + Python

Arduino + Python




There has been a problem: when sending a command to Arduino, the Serial-port is overwhelmed every time, which leads to a reboot of the board.

came up with such a solution: to put a looped program with a constantly open Serial port, which each cycle reads the file. And in this file already write commands from a web server.

Question: Is such a situation possible that the command to the file is incompletely shown by one program, and the other program (looped, which sends commands through the port) read these incomplete data? And what to do with it?

Answer 1

Serial port stores all the information until it reads it to put it in so called buffer. The buffer stores information before reading it or reset (cleaning it or reboot the program).

Is such a situation that the command in the file has become incompletely discharged
one program, and another program (looped, which sends
Commands through the port) read these incomplete data? And what to do with it?

responding to your question:

  • Port can only listen to one program, you fail to connect to one port by two programs, the port is blocked.
  • If you sent the team and the program did not have time to read it – then you lose this command.
  • Yes, you can write these commands to the file and then work with them.

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions