Go Down

Topic: communicate between a desktop XP and a arduino uno (Read 803 times) previous topic - next topic

nickynichols

Using a usb connection from my desktop XP compter to my arduino uno, can I communicate back and forth.  For example, using a progaram in C# in my computer, I would like to tell my arunio when to turn on and off digital pin 5.  nickynichols 

CrossRoads

Yes you can.
I have not programmed the PC side, only sent info from keboard thru the USB.
Arduino side is very straightforward to receive serial input and act on it.
http://arduino.cc/en/Reference/Serial

basics are:
check if data came in with
if (Serial.available() >0){

then read it into a variable to act in
incomingbyte = Serial.read();

then act on it
    if (incomingbyte == value_you_want){
    //act on it
    }
}
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy