Pages: [1]   Go Down
Author Topic: communicate between a desktop XP and a arduino uno  (Read 590 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 439
Posts: 23728
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
    }
}
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1]   Go Up
Jump to: