I wrote a simple code in which Arduino generate random numbers and they are transmitted via serial port. I have two questions:
How can I activate the communication only to connect the usb without open serial monitor?
When I open the serial monitor, Arduino starts to sent data, I close the serial monitor and after about one minute the TX led stops blinking and the communication is interrupted. Why? I'd like a communication for long time.
If you are not receiving numbers in the Serial Monitor what is the point of transmitting stuff?
The Tx led may go off because it can't send any more stuff (the buffer is full, and not being emptied) but the Arduino program probably keeps on running.
Add a few lines of code to make an LED blink so you can tell whether the program is still running.
So I'll try with a LED blink. But Is it possible to fill the buffer with a delay of 500ms?!? I think that it is slow enough to empty it.
And about my first question have you any idea?
woodstock:
So I'll try with a LED blink. But Is it possible to fill the buffer with a delay of 500ms?!? I think that it is slow enough to empty it.
Just delay it by 500ms, it's already in your code.
woodstock:
How can I activate the communication only to connect the usb without open serial monitor?
Not sure what you mean by this. You want it to send data to the USB but you don't want to open a serial port? what are you using to check the data?
Also be aware: If you open a serial line half way through your program the arduino will reset and the buffer will empty then.
So a continually connection is advised.
There are ways of disabling the auto-reset, but it requires more sweat than to leave the port open.
Not sure what you mean by this. You want it to send data to the USB but you don't want to open a serial port? what are you using to check the data?
In the priliminary test I want to check the value on the serial monitor but after I'll connect Arduino with a external power supply and I wish that it doesn't stop.
I want to generate random values and printing them on the LCD screen.
woodstock:
In the priliminary test I want to check the value on the serial monitor but after I'll connect Arduino with a external power supply and I wish that it doesn't stop.
I want to generate random values and printing them on the LCD screen.
How can I activate the communication only to connect the usb without open serial monitor?
I don't understand this either.
What makes you think it will stop? Have you tried it with your LCD screen?
Not sure what you mean by this. You want it to send data to the USB but you don't want to open a serial port? what are you using to check the data?
In the priliminary test I want to check the value on the serial monitor but after I'll connect Arduino with a external power supply and I wish that it doesn't stop.
I want to generate random values and printing them on the LCD screen.
I think you'r over-thinking the problem.
If you disconnect your serial monitor it's true the buffer will fill up until you empty it again. But why not just let it happen?
Your program will just continue and no harm's done.
And if your LCD is programmed by serial (Probably not but just thinking out loud) the buffer will be read and emptied.
Conclusion: Just try it, your program won't crash!
I have been having problems with serial monitor, Win 8.1.
It stops suddenly and then will lock the com port - is that the sort of problem you have been having?
walshlg:
I have been having problems with serial monitor, Win 8.1.
It stops suddenly and then will lock the com port - is that the sort of problem you have been having?
This is the first time I have felt it necessary to comment on a Forum members choice of picture. Those blinking eyes are a dreadful PITA. Please get rid of them.