Hello! I am trying to make myself a pc hardware monitor using an arduino pro mini and an lcd screen. The problem is, when i'm trying to give the arduino any string, including Serial.read() and other methods, it spits out some weird characters in the serial monitor. It didnt do this until today.
This is my test code:
void setup()
{
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
Serial.println("hi");
delay(5000);
}
The thing it outputs in the serial monitor is "����怘�".
What could be wrong?
Yes, it is. I tried setting the serial monitor and the arduino on other baudrates(e.g. 19200) but it was the same. Also, tried (!Serial) but to no avail.
If only one line of nonsense is printing on startup and then operation continues with normal, readable characters as expected, you may just be seeing garbage in the USB input buffer (a PC OS problem).
This sometimes happens to me and I ignore the nonsense.
This happens on my pc and on my laptop. Also, it wasnt happening till today. Could it be the flash on board or something? The odd thing is that if i tell it to print let's say "hi", it prints some complete nonsense.
Hi @luciantermopan. Are you using Arduino IDE? If so, check to be sure you have the correct selection under the Tools > Processor menu for your board in Arduino IDE.
Several variants of the Pro Mini are available. Some have a 16 MHz clock, while others (less common) have an 8 MHz clock. The Tools > Processor menu contains an option for each of these. If you have the menu set to the wrong clock speed when you upload a sketch to your board, this will cause the serial code to use an incorrect baud rate, which will cause the garbage characters output like what you are seeing.