Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Purpose

Know if a remote controller connected to the CrcDuino via a CrcConnect module.

When to use

Whenever you need to check if the communication with the remote controller is up.

Where to use

In the void loop() part of your .ino file. The connection is not established when the void setup() part of your .ino file is executed.

Info

Click here to learn more on the CrcConnect system, that allows to control a CrcDuino using popular off-the-shelf remote controllers.

Note

This function requires the use of the following CrcLib functions at some point of your .ino file in order to work properly:

Returns

This function returns the status of the communication with a remote controller as a booltype.

  • LOW, if the connection is not established

  • HIGH, if the connection is established

Main prototype and parameters

static bool CrcLib::isCommValid();

The following parameters must be passed to the function for it to work properly:

  • No parameters needed.

Overloads

This function does not have any overloads. It can only be used as described by the main prototype.

Examples

Expand
title#1: We want to print on the serial monitor a smiley face if the CrcDuino is connected to a CrcConnect module,and a sad face when it's not.
Code Block
languagecpp
#include <CrcLib.h>

using namespace Crc;

void setup() {
    CrcLib::Initialize();

    Serial.begin(2000000);  //Open the serial monitor at a 2000000 baud rate
    
    /* 
    The rest of your setup code
    ...
     */
}
void loop() {
    CrcLib::Update();

    if(CrcLib::isCommValid())
    {
      Serial.println(":)");
    }
    else
    {
      Serial.println(":(");
    }
    
    /* 
    The rest of your looping code
    ...
    */
}

More on this function

Info

A “physical” way to tell if the communication is established between the CrcDuino and the CrcConnect is to check if the board mounted “X2” LED is lit on the CrcDuino, or if the “COM” LED on the CrcConnect module is lit.

Articles liés

Related articles

Filter by label (Content by label)
sorttitle
excerptTyperich content
cqllabel = "ar-crcconnect_fren"