Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

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.

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

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 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

 #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.
#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

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

  • No labels

0 Comments

You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.