Need help and advice: send message from arduino to computer

So as a rookie who just started playing with the arduino, I setup an ultrasonic range finder with LCD display. Although now I can read the distance off from the LCD on the breadboard, I want to know if there is a way for the arduino to communicate with the computer.

In another word, when the ultrasonic sensor detects an object, I should be able to see a text such as "yes, there is an object" or "no, there is nothing". But how do I do that?

I have also attached the code. I appreciate any help on how to achieve the effect I want.

PS: Don't know why but the LCD on the breadboard is so dim and I could barely read the numbers off it. Is it the display or does it indicate a mistake I made when setting things up?

sketch_feb02a.ino (644 Bytes)

I want to know if there is a way for the arduino to communicate with the computer.

Of course. That is what Serial.print() is all about.

Of course, that means that you need an application on the PC that is listening the to serial port that the Arduino is connected to. For testing, the Serial Monitor app, started from the IDE, can fill that role.

This Python - Arduino demo may be of interest.

But experiment with the Serial Monitor first.

...R

andrewqin47:
PS: Don't know why but the LCD on the breadboard is so dim and I could barely read the numbers off it. Is it the display or does it indicate a mistake I made when setting things up?

LCD modules usually have a potentiometer on the back you can use to adjust the contrast.

Thanks guys. So I took away the LCD and use the Serial print command and the serial monitor to make the command appears. I appreciate all the tips! :slight_smile: