NSLbus - VCSFA-MARS/TSLPB GitHub Wiki

Overview

NSLbus is the controller object for the software serial connection from the TSLPB to the NSL "Mothership." This object is not needed for typical applications. Use pushDataToNSL whenever possible. Only use the NSLbus object if you need to implement your own communication between the TSLPB and the NSL "mothership"

The standard Arduino Serial commands are available, such as:

  • NSLbus.write();
  • NSLbus.read();
TSLPB::TSLPB() : NSLbus (TSL_NSL_BUS_RX_PIN, TSL_NSL_BUS_TX_PIN)

Returns

Not applicable

Arguments

Not Applicable

Usage

NSLbus is instantiated when the TSLPB object is created and it is initiated with the TSLPB::begin() function. Once initiated, the NSLbus object is used just like Arduino's Serial object.

Example

The following example creates a TSLPB controller object called pb, and then tries to write a single byte of data (0xFF) to the NSL "Mothership" every 5 seconds. Note the use of isClearToSend, which checks to see if the NSL bus is able to receive data.

TSLPB pb;

void setup() {
    pb.begin();
}

void loop() {
    if isClearToSend() {
        NSLbus.write(0xFF, 1);
    }
    delay(5000);
}

NOTE: This does not conform to the NSL ICD, and would likely be rejected by the NSL "mothership." This code is only intended to show how to invoke serial commands on the NSLbus object.