Versions Compared

Key

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

Purpose

Print the received state of the controller attached to the CrcConnect.

When to use

When you want to verify if the CrcConnect has some issues.

Where to use

Inside the loop function, after having called Serial.begin in the setup.

Note

This function requires Serial communication, so make sure you called Serial.begin in setup().

Note

The Serial link takes some time to work its magic. Make sure you do not call this function every loop, for example by using a delay.

Returns

This function does not return a value once it has completed its tasks.

Main prototype and parameters

static void Crc:: CrcLib::PrintControllerState()

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: Debug the state of the remote connection
Code Block
languagecpp
#include <CrcLib.h>

using namespace Crc;

Timer timer;
void setup() {
    CrcLib::Initialize();
    
    // Setup the serial link
    Serial.begin(115200);
    
    // Start the timer with a period of 10 ms
    timer.Start(10);

    /* 
    The rest of your setup code
    ...
     */
}
void loop() {
    CrcLib::Update();
    
    if (timer.IsFinished()) { // 10 ms has elapsed
        timer.Next(); // Start the next period of the timer
        
        // Then print the controller state
        CrcLib::PrintControllerState();
    }
    
    /* 
    The rest of your looping code
    ...
    */
}

More on this function

There is sadly nothing more to be said about this function…

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