[SoftwareSerial]
Description
Tests to see if requested software serial port is actively listening.
Syntax
// set up a new serial port SoftwareSerial mySerial = SoftwareSerial(rxPin, txPin); mySerial.isListening()
Parameters
none
Returns
boolean
Example
#include <SoftwareSerial.h>
// software serial : TX = digital pin 10, RX = digital pin 11
SoftwareSerial portOne(10,11);
void setup()
{
// Start the hardware serial port
Serial.begin(9600);
// Start software serial port
portOne.begin(9600);
}
void loop()
{
if (portOne.isListening()) {
Serial.println("Port One is listening!");
}See also
- SoftwareSerial()
- SoftwareSerial.begin()
- SoftwareSerial.read()
- SoftwareSerial.print()
- SoftwareSerial.println()
Libraries Reference Home
The text of the 86Duino reference is a modification of the Arduino reference and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.