Serial Monitor Receive garbage values....

I have setup a bluetooth on my arduino UNO board with an LED. and i could not get the string value when i am sending in the data. what could the problem be?

Insure the Serial Monitor Windows baud rate is set to match what you have in the sketch, you can change it on the fly. Your screen capture looks like it should be 9600

Yes. It is both 9600 baut… but it still doesn’t work. I sent the data in through unWired Lite and the received data is the same with some garbage

jiaqibitehumans: what could the problem be?

Could be several things, but your code is as incoherent as your intentions.

You appear to be trying to use the serial monitor to communicate with Arduino via bluetooth, with both on hardware serial. This won't work. but you can have serial monitor connected in order to observe comms with another bluetooth device, like a phone. If you are not actually using the serial monitor as stated but are really using a kosher terminal, now is the time to tell us.

If you are trying to communicate between PC and Arduino via bluetooth, you can do this using a proper terminal programme like RealTerm and PC's bluetooth facility, whatever that is, and your code may be fine for that.

There is a good chance that you are not actually communicating via bluetooth at all and HC-05 is entirely innocent, in which case why mention it? Maybe you don't even intend communicating via bluetooth, yet, in which case the same applies. This is not an unreasonable situation, as you can test bluetooth code using the serial monitor without bluetooth connected. You can prove you are communicating via bluetooth by disconnecting the USB cable.

Pardon me, i am still really new at this and trying to understand... I am actually using RN-42 bluetooth module to aid this project. however, i am actually following a guide to use unwired lite to communicate with the bluetooth. and yes, i am connecting to COMM 22 to my PC and just trying to light up the LED... i am still unsure of what is going on, do i need a physical battery if i disconnect the USB?

I now recognise that you did not mention HC-05 and I jumped to the conclusion. I am not familiar with the RN-42 but bluetooth is bluetooth, so I guess the same principles apply. I have never heard of unwired lite, the code looks like it is for HC-05. This does not mean you cannot use it with RN-42 but, if Unwired allows you to communicate with RN-42 without using the serial port, I don't believe there is evidence of that in the code. This doesn't mean you can't do it. Maybe Unwired is a hardware device that, like bluetooth, can be used without any special code.

To clarify, if RN-42 has Tx and Rx serial pins like any other bluetooth, you should be able to use it like any other Bluetooth, and Unwired may very well be redundant, but talking to PC via bluetooth is done using a kosher terminal, not the serial monitor.

I was referring to a 9v wall wart rather than a battery, and it is certainly more preferable at this stage. The easiest and most assuring way to test everything beyond doubt is to power Arduino how you like, even USB, but definitely not a 9v PP3, and then talk to a phone. ...

Nick_Pyner: You can prove you are communicating via bluetooth by disconnecting the USB cable.

Thank you, I have managed to solve the problem by using an extension library SoftwareSerial and changing the Rx=0 Tx=1 Ports to a different number. It is much more convenient too!

Thank you all once again.