Where can I see outputs from such instruction in an ino file ?
Serial.println("my message");
-
1Click the magnifier icon in the top right corner of the window.Gerben– Gerben2015年05月06日 18:07:14 +00:00Commented May 6, 2015 at 18:07
3 Answers 3
The Serial.print statements show up on whatever terminal program is opened and connected. Their can be only one open at a time, but it could the Arduino IDE built in monitor (ctl-shft-m) or an external terminal program, eg putty, or some other program you wrote that opened the com/serial port the Arduino is on.
Remember though - only 1 can be open at a time. If you use an external program you MUST close the com port before attempting to download a new version of your sketch. If you use the built in monitor/terminal it will automatically do this for you.
-
Thanks. In fact I think my logs are not visible because the uploading process never ends. I use an arduino BLE nano; any idea on how to fix the problem ?user9891– user98912015年05月07日 09:21:55 +00:00Commented May 7, 2015 at 9:21
-
Nope. Sorry never tried anything like that. Are you saying you are uploading your sketch via BLE and it never finishes? Im not familiar with those products, but they look interesting.user6569– user65692015年05月07日 13:43:14 +00:00Commented May 7, 2015 at 13:43
-
No I 'm not uploading via BLE, just using the upload button on Arduino IDE, but it never endsuser9891– user98912015年05月07日 15:25:20 +00:00Commented May 7, 2015 at 15:25
-
This helped, but I also needed to initialize the serial library in the setup method -
Serial.begin(9600);
- described here before logs showed up in the IDE monitor: forum.arduino.cc/index.php?topic=25326.0Brandon Linton– Brandon Linton2017年11月06日 03:36:11 +00:00Commented Nov 6, 2017 at 3:36
It took me ages to realize that instead of remembering Ctrl-Shft-M you can just click on the little magnifying glass in the upper right of the IDE interface. Wait until after your script uploads though, it won't do anything while compiling or uploading your script.
Screen Shot of Arduino IDE interface showing serial monitor icon
Call Serial.begin(9600)
in your setup()
function:
void setup() {
Serial.begin(9600);
}
Call Serial.print('example')
or Serial.println('example')
in your loop()
function (or one of your own functions that your loop()
function calls:
void loop() {
Serial.print('example');
Serial.print('example');
// Output of the two calls above: exampleexample
Serial.println('example');
Serial.println('example');
// Output of the two calls above:
// example
// example
}
Go to Tools > Serial Monitor to see the output.
References: