My serial monitor prints strange characters (like these: !���h�)��!�1!!�3�
|!�!��ԊNB��1!� 9��1�� 11��̺ʌ.��J��1�!1!1�!�����H�J�H��EΘ�)�!1�9f1��m1��LB��Ȋ����)>��)��1!�O�) ���0 α)��������!�!!!LN)�!��ա�̺ʌ��J��81!1�!1�!�����H�J�H�����1S1�9��9f1������
�!����1!11!11!9 �Fs�� �b����@�w�Ρ!!��) . It just happened, I don't know why. It's not a hardware issue, because my sensors work, I think that's a baud rate problem, but it seems that is all good.
What speed is set on your serial monitor?
Here.
From the screenshot posted by @s3m01
Mega2560 TX1 is pin 18. @sterretje thank you,my mistake... i did not see the board name.
Did you post in the wrong topic. OP's screenshot shows an ESP32.
This looks like IDE 2.x, not 1.x
Since I can see from the screenshot that @s3m01 is using Arduino IDE 2.x instead of 1.x (as pointed out by @PaulRB), I have now moved the topic to the appropriate IDE 2.x category.
Carry on.
Everything looks fine, but first of all: please don't post code as a picture, it prevents other people to get and test your own code (and we don't want to type it again...). A weird serial output like that can be posted as a picture if it contains non-printable characters, but don't include the code, please. thanks. (if possible, edit your first post and replace the picture with a block of "code", and add just a clip of the original picture to show the weird characters -to be removed from the upper text body-).
Said that, I can see your code sets 9600 baud for both the Serial port and Serial Monitor, so it can't be a baud rate problem.
First question: it's pretty trivial to ask you this, but are you sure you have just uploaded that code we can see on your screen before that output came out? Just as a note, if you had a "Serial.begin(115200);" (or any other speed different from 9600) and changed to 9600, you won't get the right output.
Second question: if the sketch was correctly loaded, are you sure you don't have any other device (e.g. other Arduino or ESP) connected to the USB port mapped as COM7, so receiving other board output (set with different baud rate)?
Third question: after closing the IDE, if you open the COM7 using any another terminal software (like putty or MobaXterm for example), do you get the same result if set at 9600 (N81)?
Last question: back to the IDE, what happens if you change the speed from the lower selection? Try the other speeds, one after each other, and see if the output turns to be clear and readable. At that point, that speed is the speed you must use.
If all those tests fail, I'm sorry dude, I don't have any other idea about that (except for a device driver failure, but that prevents you from uploading the code also...).
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.