Arduino - SoftwareSerialPrintln
Arduino
Buy
|
Download
|
Getting Started
|
Learning
|
Reference
|
Hardware
|
FAQ
Blog » |
Forum » |
Playground »
Reference Language | Libraries | Comparison | Changes
SoftwareSerial: println(data)
Description
Prints data to the transmit pin of the software serial port, followed by a carriage return and line feed. Works the same as the Serial.println() function.
Parameters
vary, see Serial.println() for details
Returns
none
Example
SoftwareSerial serial(6, 7);
int analogValue;
void setup()
{
serial.begin(9600);
}
void loop()
{
// read the analog input on pin 0:
analogValue = analogRead(0);
// print it out in many formats:
serial.print(analogValue); // print as an ASCII-encoded decimal
serial.print("\t"); // print a tab character
serial.print(analogValue, DEC); // print as an ASCII-encoded decimal
serial.print("\t"); // print a tab character
serial.print(analogValue, HEX); // print as an ASCII-encoded hexadecimal
serial.print("\t"); // print a tab character
serial.print(analogValue, OCT); // print as an ASCII-encoded octal
serial.print("\t"); // print a tab character
serial.print(analogValue, BIN); // print as an ASCII-encoded binary
serial.print("\t"); // print a tab character
serial.print(analogValue/4, BYTE); // print as a raw byte value (divide the
// value by 4 because analogRead() returns numbers
// from 0 to 1023, but a byte can only hold values
// up to 255)
serial.print("\t"); // print a tab character
serial.println(); // print a linefeed character
// delay 10 milliseconds before the next reading:
delay(10);
}
See also
SoftwareSerial()
begin()
read()
print()
Reference Home
Corrections, suggestions, and new documentation should be posted to the Forum.
The text of the Arduino reference is licensed under a
Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.
var addthis_language = "en";
Share|
Edit Page | Page History | Printable View | All Recent Site Changes
Wyszukiwarka
Podobne podstrony:
Software User Guideprinting softwarecsps software architecture documentsoftware raid 4 is4cfpesn6jimgedkvsbmbmn37dfse6nqf4mpxq is4cfpesn6jimgedkvsbmbmn37dfse6nqf4mpxq2000 11 Corel Photopaint 9 Image Editing Softwarerup software requirements specification?4E66Fsoftware building 6 2ocvurnawmtlrc3nobvr5ybctyvu4z555g7oeiq 2ocvurnawmtlrc3nobvr5ybctyvu4z555g7oeiqSoftwareSerialBeginsoftware05csps software?velopment planSoftwareSerialConstructorsoftware architecture document informal6E1F0SoftwareSerialBeginwięcej podobnych podstron