I am a complete novice in Arduino and moderatly experienced with the language c++. What if I want to use the output from the serial monitor in a c++ code in real time. Also how can I write to the serial monitor. Which libraries are available for this? Also please give me links to sites where I can learn more about this topic. I am using Arduino UNO.
|
Unfortunately, C++ doesn't have native support for serial I/O. You could use the Windows API directly if you're feeling adventurous. It can be a little complicated to get to grips with, but not insurmountable. You can get basic information about it here. There's an example of using it with Arduino here. As an alternative, you could use a 3rd party library. This one looks good, although I haven't actually used it myself. |
|||
|
try this one, it should work. Comment below if it does not work. You might reset Arduino to read data in method |
|||||||||||||
|
@Peter has already posted library links. I recommend that you use node.js(node-serialport) or python(serial), which have excellent native serial support. Both of these use C++ internally to communicate over Serial (Serial.h). Try going through the code Node.js uses internally and if you are willing to write that much, by all means use the library |
|||
|