Skip to content

Instantly share code, notes, and snippets.

@roboticboyer
Created January 3, 2015 14:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roboticboyer/cf42fb99871ccbeeeff2 to your computer and use it in GitHub Desktop.
Save roboticboyer/cf42fb99871ccbeeeff2 to your computer and use it in GitHub Desktop.
Sw_Serial_Echo
#include <SoftwareSerial.h>
SoftwareSerial esp8266(9, 10); // RX, TX
void setup()
{
// Open serial communications and wait for port to open:
//Serial.begin(9600);
Serial.begin(57600);
esp8266.begin(9600);
Serial.println("Echo da Seriale 00");
}
void loop() // run over and over
{
//Serial.print("Caratteri ricevuti: ");
//Serial.println(esp8266.available());
int i=0;
while (esp8266.available()>0 ){
i++;
Serial.write(esp8266.read());
}
/*
delay(100);
if (i != 0) {
Serial.print("Caratteri ricevuti: ");
Serial.println(i);
Serial.println("Fine Trasmissione");
Serial.print("\r\n\r\nr\n\r\n");
}*/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment