Serial.Println History

Hide minor edits - Show changes to markup

May 31, 2010, at 07:16 PM by Equipo Traduccion -
Changed lines 5-9 from:

Description

Prints data to the serial port as human-readable ASCII text followed by a carriage return character (ASCII 13, or '\r') and a newline character (ASCII 10, or '\n'). This command takes the same forms as Serial.print().

Syntax

to:

Descripción

Imprime los datos al puerto serie como texto ASCII seguido de un retorno de carro (ASCII 13, o '\r') y un carácter de avance de línea (ASCII 10, o '\n'). Este comando tiene la misma forma que Serial.print ().

Sintaxis

Changed lines 14-22 from:

Parameters

val: the value to print - any data type

format: specifies the number base (for integral data types) or number of decimal places (for floating point types)

Returns

None

to:

Prarámetros

val: el valor a imprimir - de cualquier tipo

format: especifica el número de la base (para números enteros) o el número de posiciones decimales (para números de coma flotante o tipo "float")

Devuelve

Nada

Changed line 29 from:
 reads an analog input on analog in 0, prints the value out.
to:
 Lee el pin analógico 0, e imprime su valor por el puerto serie.
Changed lines 35-36 from:

int analogValue = 0; // variable to hold the analog value

to:

int analogValue = 0; // variable para guardar el valor analogico

Changed line 38 from:
  // open the serial port at 9600 bps:
to:
  // abre el puerto serie a 9600 bps:
Changed line 43 from:
  // read the analog input on pin 0:
to:
  // lee la entrada analogica en el pin 0:
Changed lines 46-52 from:
  // print it out in many formats:
  Serial.println(analogValue);       // print as an ASCII-encoded decimal
  Serial.println(analogValue, DEC);  // print as an ASCII-encoded decimal
  Serial.println(analogValue, HEX);  // print as an ASCII-encoded hexadecimal
  Serial.println(analogValue, OCT);  // print as an ASCII-encoded octal
  Serial.println(analogValue, BIN);  // print as an ASCII-encoded binary
  Serial.println(analogValue, BYTE); // print as a raw byte value
to:
  // imprime el valor en varios formatos:
  Serial.println(analogValue);       // imprime como ASCII decimal
  Serial.println(analogValue, DEC);  // imprime como ASCII decimal
  Serial.println(analogValue, HEX);  // imprime como ASCII hexadecimal
  Serial.println(analogValue, OCT);  // imprime como ASCII octal
  Serial.println(analogValue, BIN);  // imprime como ASCII binario
  Serial.println(analogValue, BYTE); // imprime el valor del byte
Changed line 54 from:
  // delay 10 milliseconds before the next reading:
to:
  // espera 10 milisegundos antes de la siguiente lectura.
Changed line 59 from:

See also

to:

Ver también

February 08, 2010, at 04:54 AM by David A. Mellis -
Changed lines 10-12 from:

Serial.print(val)
Serial.print(val, format)

to:

Serial.println(val)
Serial.println(val, format)

February 01, 2010, at 07:19 PM by David A. Mellis -
Changed lines 7-36 from:

Prints a data to the serial port, followed by a carriage return character (ASCII 13 or '\r') and a newline character (ASCII 10 or '\n'). This command takes the same forms as Serial.print().

Serial.println(b) prints b as a decimal number in an ASCII string followed by a carriage return and a linefeed.

Serial.println(b, DEC) prints b as a decimal number in an ASCII string followed by a carriage return and a linefeed.

Serial.println(b, HEX) prints b as a hexadecimal number in an ASCII string followed by a carriage return and a linefeed.

Serial.println(b, OCT) prints b as an octal number in an ASCII string followed by a carriage return and a linefeed.

Serial.println(b, BIN) prints b as a binary number in an ASCII string followed by a carriage return and a linefeed.

Serial.print(b, BYTE) prints b as a single byte followed by a carriage return and a linefeed.

Serial.println(str) if str is a string or an array of chars, prints str an ASCII string.

Serial.println() just prints a carriage return and a linefeed.

Parameter

data types: integer types, including char, strings (char arrays) & floats

to:

Prints data to the serial port as human-readable ASCII text followed by a carriage return character (ASCII 13, or '\r') and a newline character (ASCII 10, or '\n'). This command takes the same forms as Serial.print().

Syntax

Serial.print(val)
Serial.print(val, format)

Parameters

val: the value to print - any data type

format: specifies the number base (for integral data types) or number of decimal places (for floating point types)

February 01, 2010, at 05:30 PM by David A. Mellis -
Changed lines 35-38 from:

data types: integer types, including char, strings (char arrays) & floats
Printing of floats is supported with a precision of two places to the right of the decimal point.
This may change soon.

to:

data types: integer types, including char, strings (char arrays) & floats

February 01, 2010, at 05:30 PM by David A. Mellis -
Changed lines 1-2 from:

Serial.println(data)

to:

Serial

println()

Changed lines 7-8 from:

Prints a data to the serial port, followed by a carriage return character(ASCII 13, or '\r') and a newline character (ASCII 10, or '\n'). This command takes the same forms as Serial.print():

to:

Prints a data to the serial port, followed by a carriage return character (ASCII 13 or '\r') and a newline character (ASCII 10 or '\n'). This command takes the same forms as Serial.print().

Deleted lines 78-80:

Programming Tip / Known Issues

see Serial.print

Changed lines 80-88 from:
to:
July 24, 2009, at 01:20 AM by Paul Badger -
Changed lines 31-37 from:

Parameters

b: the byte to print, or

str: the string to print

to:

Parameter

data types: integer types, including char, strings (char arrays) & floats
Printing of floats is supported with a precision of two places to the right of the decimal point.
This may change soon.

July 24, 2009, at 01:17 AM by Paul Badger -
November 04, 2008, at 07:31 AM by Massimo Banzi -
Changed line 67 from:
  Serial.print(analogValue, DEC);  // print as an ASCII-encoded decimal
to:
  Serial.println(analogValue, DEC);  // print as an ASCII-encoded decimal
July 19, 2007, at 05:29 AM by Paul Badger -
Added lines 76-80:

Programming Tip / Known Issues

see Serial.print

Added line 90:
May 31, 2007, at 04:38 PM by David A. Mellis - we don't care about the old serial library any more (it should be removed soon)
Changed lines 5-6 from:

Prints a data to the serial port, followed by a carriage return character(ASCII 13, or '\r') and a newline character (ASCII 10, or '\n'). (Note that the printNewline() function from the old serial library sent only a newline.) This command takes the same forms as Serial.print():

to:

Prints a data to the serial port, followed by a carriage return character(ASCII 13, or '\r') and a newline character (ASCII 10, or '\n'). This command takes the same forms as Serial.print():

May 30, 2007, at 06:25 PM by Paul Badger -
Changed lines 75-78 from:

}

@]

to:

}@]

May 30, 2007, at 06:25 PM by Paul Badger -
Deleted lines 76-77:
Added line 80:
June 08, 2006, at 06:07 PM by David A. Mellis - old printNewline() only send newline
Changed lines 5-6 from:

Prints a data to the serial port, followed by a carriage return character(ASCII 13, or '\r') and a newline character (ASCII 10, or '\n'). This command takes the same forms as Serial.print():

to:

Prints a data to the serial port, followed by a carriage return character(ASCII 13, or '\r') and a newline character (ASCII 10, or '\n'). (Note that the printNewline() function from the old serial library sent only a newline.) This command takes the same forms as Serial.print():

March 27, 2006, at 08:58 PM by Tom Igoe -
Changed lines 5-6 from:

Prints a data to the serial port, followed by a carriage return character(ASCII 13, or '\r') and a newline character (ASCII 10, or '\n'). This command takes the same forms as Serial.print():

to:

Prints a data to the serial port, followed by a carriage return character(ASCII 13, or '\r') and a newline character (ASCII 10, or '\n'). This command takes the same forms as Serial.print():

Changed lines 82-85 from:
to:
March 27, 2006, at 08:55 PM by Tom Igoe -
Added line 21:
March 27, 2006, at 08:55 PM by Tom Igoe -
Changed lines 21-23 from:
to:

Serial.print(b, BYTE) prints b as a single byte followed by a carriage return and a linefeed.

March 27, 2006, at 08:51 PM by Tom Igoe -
Changed lines 64-65 from:
   Serial.print(analogValue, DEC);  // print as an ASCII-encoded decimal
   Serial.println(analogValue, HEX);  // print as an ASCII-encoded hexadecimal
to:
  Serial.print(analogValue, DEC);  // print as an ASCII-encoded decimal
  Serial.println(analogValue, HEX);  // print as an ASCII-encoded hexadecimal
March 27, 2006, at 08:51 PM by Tom Igoe -
Changed lines 1-2 from:

Serial.print(data)

to:

Serial.println(data)

March 27, 2006, at 08:50 PM by Tom Igoe -
Changed line 7 from:

Serial.printlnln(b)

to:

Serial.println(b)

Changed lines 79-81 from:

to:
March 27, 2006, at 08:50 PM by Tom Igoe -
Added lines 1-82:

Serial.print(data)

Description

Prints a data to the serial port, followed by a carriage return character(ASCII 13, or '\r') and a newline character (ASCII 10, or '\n'). This command takes the same forms as Serial.print():

Serial.printlnln(b) prints b as a decimal number in an ASCII string followed by a carriage return and a linefeed.

Serial.println(b, DEC) prints b as a decimal number in an ASCII string followed by a carriage return and a linefeed.

Serial.println(b, HEX) prints b as a hexadecimal number in an ASCII string followed by a carriage return and a linefeed.

Serial.println(b, OCT) prints b as an octal number in an ASCII string followed by a carriage return and a linefeed.

Serial.println(b, BIN) prints b as a binary number in an ASCII string followed by a carriage return and a linefeed.

Serial.println(str) if str is a string or an array of chars, prints str an ASCII string.

Serial.println() just prints a carriage return and a linefeed.

Parameters

b: the byte to print, or

str: the string to print

Returns

None

Example:

/*
  Analog input

 reads an analog input on analog in 0, prints the value out.

 created 24 March 2006
 by Tom Igoe
 */

int analogValue = 0;    // variable to hold the analog value

void setup() {
  // open the serial port at 9600 bps:
  Serial.begin(9600);
}

void loop() {
  // read the analog input on pin 0:
  analogValue = analogRead(0);

  // print it out in many formats:
  Serial.println(analogValue);       // print as an ASCII-encoded decimal
   Serial.print(analogValue, DEC);  // print as an ASCII-encoded decimal
   Serial.println(analogValue, HEX);  // print as an ASCII-encoded hexadecimal
  Serial.println(analogValue, OCT);  // print as an ASCII-encoded octal
  Serial.println(analogValue, BIN);  // print as an ASCII-encoded binary
  Serial.println(analogValue, BYTE); // print as a raw byte value

  // delay 10 milliseconds before the next reading:
  delay(10);
}




See also

Reference Home

Share