Jump to content

Hello. I am doing a mini project for myself and is wondering why gibberish string of text appear in my serial monitor?

Both of them are at 9600 baud. and it still doesn't work. I sent the data through unWired Lite and also recieved data that are gibberish... Anyone knows what is the problem? Thank you!

Capture.PNG

Link to comment
https://linustechtips.com/topic/905633-arduino-bluetooth-testing/
Share on other sites

Link to post
Share on other sites

Serial is the class that has the functions interacting with your monitor. 

Every time it says serial it’s doing something with your monitor. 

The value “1/4” a value sent by the arguing based off a calculation. I don’t know what the program is doing entirely but the 1/4 is a result from an equation of some sort. 

Link to post
Share on other sites

Well, I'm not sure about Arduino exactly, but there are more than a few languages that won't evaluate if statements following an else block in the same scope. In other words, make sure your program isn't evaluated like this:

 

if (something)
{
  // Do something
}

else
{
  // Do other something
}

if (ThisWillNeverEvaluate)
{
  // doesn't matter
}


Otherwise, I don't see where in your main loop you would ever be writing to serial, so that part confuses me.

Can you upload your program as is in plain text so I can copy pasta it into a linter and check to make sure all parens and braces are matched?


 

ENCRYPTION IS NOT A CRIME

Link to post
Share on other sites

The gibberish could come from interference to the Bluetooth device as there is no write or print to serial in the loop() function.

Did you try and wait for the serial to be active in the setup() before using the Serial.println?

Just add a line after the Serial.begin with

 

while (!Serial) ;

This will wait for the serial connection to be ready. Does not work on all types of Arduino of devices.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×