Reference.SoftwareSerialExample History

Hide minor edits - Show changes to markup

June 04, 2010, at 11:47 AM by Equipo Traduccion -
Deleted line 0:
Changed line 17 from:

// include the SoftwareSerial library so you can use its functions:

to:

// incluye la librería SoftwareSerial de forma que pueda utilizar sus funciones:

Changed lines 24-27 from:

// set up a new serial port SoftwareSerial mySerial = SoftwareSerial(rxPin, txPin); byte pinState = 0;

to:

// configura un nuevo puerto SoftwareSerial miSerial = SoftwareSerial(rxPin, txPin); byte pinEstado = 0;

Changed line 29 from:
  // define pin modes for tx, rx, led pins:
to:
  // define el modo para los pines tx, rx, led:
Changed lines 33-34 from:
  // set the data rate for the SoftwareSerial port
  mySerial.begin(9600);
to:
  // configura el ratio de datos para el puerto SoftwareSerial
  miSerial.begin(9600);
Changed lines 38-43 from:
  // listen for new serial coming in:
  char someChar = mySerial.read();
  // print out the character:
  mySerial.print(someChar);
  // toggle an LED just so you see the thing's alive.  
  // this LED will go on with every OTHER character received:
to:
  // escucha la llegada de nuevos datos serie:
  char unChar = miSerial.read();
  // imprime el caracter:
  miSerial.print(unChar);
  // Comunta un LED para que veas que la cosa viva
  // este LED se enciende con cada NUEVO caracter recibido:
Changed lines 50-53 from:
  // set the LED pin using the pinState variable:
  digitalWrite(pinNum, pinState); 
  // if pinState = 0, set it to 1, and vice versa:
  pinState = !pinState;
to:
  // Establece el pin del LED usando la variable pinEstado:
  digitalWrite(pinNum, pinEstado); 
  // si el pinEstado = 0, lo establece a 1, y vice versa:
  pinEstado = !pinEstado;
June 04, 2010, at 11:41 AM by Equipo Traduccion -
Changed lines 2-4 from:

This is a very basic example of SoftwareSerial. It reads in a byte at a time and mirrors it back to you:

to:

Este es un ejemplo muy básico de la librería SoftwareSerial. Lee un byte cada vez y te lo muestra por pantalla:

Changed line 6 from:
  SoftwareSerial example
to:
  Ejemplo SoftwareSerial
Changed lines 8-9 from:
  Sample of the SoftwareSerial library.  Listens for serial in on pin 2
  and sends it out again on pin 3.
to:
  Ejemplo de la librería SoftwareSeria.  Escucha el puerto serie por el pin 2
  y lo envía de nuevo por el pin 3.
Changed lines 12-15 from:
  based on examples by David Mellis and Heather Dewey-Hagborg
  written: 6 Jan 2007

to:
  basado en los ejemplo de David Mellis y Heather Dewey-Hagborg
  escrito: 6 Enero 2007

January 06, 2007, at 06:08 PM by Tom Igoe -
Added lines 1-2:
January 06, 2007, at 06:07 PM by Tom Igoe -
Added lines 1-56:

This is a very basic example of SoftwareSerial. It reads in a byte at a time and mirrors it back to you:

/*
  SoftwareSerial example

  Sample of the SoftwareSerial library.  Listens for serial in on pin 2
  and sends it out again on pin 3.

  by Tom Igoe
  based on examples by David Mellis and Heather Dewey-Hagborg
  written: 6 Jan 2007


*/

// include the SoftwareSerial library so you can use its functions:
#include <SoftwareSerial.h>

#define rxPin 2
#define txPin 3
#define ledPin 13

// set up a new serial port
SoftwareSerial mySerial =  SoftwareSerial(rxPin, txPin);
byte pinState = 0;

void setup()  {
  // define pin modes for tx, rx, led pins:
  pinMode(rxPin, INPUT);
  pinMode(txPin, OUTPUT);
  pinMode(ledPin, OUTPUT);
  // set the data rate for the SoftwareSerial port
  mySerial.begin(9600);
}

void loop() {
  // listen for new serial coming in:
  char someChar = mySerial.read();
  // print out the character:
  mySerial.print(someChar);
  // toggle an LED just so you see the thing's alive.  
  // this LED will go on with every OTHER character received:
  toggle(13);

}


void toggle(int pinNum) {
  // set the LED pin using the pinState variable:
  digitalWrite(pinNum, pinState); 
  // if pinState = 0, set it to 1, and vice versa:
  pinState = !pinState;
}


Share