Monday 17 June 2019

Serial Communication of Arduino and PC:

 

Code: ESP 8266 interfacing with Arduino uno


/**********************************************************
Expt. ***:Serial Communication between PC & Arduino
Platform:  Arduino IDE & PC.
College: PICT
**********************************************************/ 
char x;
void setup()
 {
  // put your setup code here, to run once:
Serial.begin(9600);
pinMode(13,OUTPUT);
 }

void loop() {
  // put your main code here, to run repeatedly:
if(Serial.available()>0)
{
  x=Serial.read();
  //Serial.write(x);
  if(x=='a')
  {
  digitalWrite(13,HIGH);
  }
  if(x=='b')
  {
  digitalWrite(13,LOW);
}
}
} 



3 comments:

  1. Thanks for sharing like this content. I really appreciate sharing your post. and also you can go through this site and read the interesting thing Embedded Design

    ReplyDelete
  2. Thanks for sharing nice post. I have taken Embedded Development Services in India and I am very much satisfied with their services.

    ReplyDelete