SBB Micro
Source code for the self-balancing-bike microcontroller unit (Teensy 4.1-based). 🚀️
Loading...
Searching...
No Matches
RemoteCtrl Struct Reference

Signals from remote controller. More...

#include <objects.h>

Public Attributes

int16_t ch [NUM_CH_SBUS] = { ZERO_SBUS }
 Channels from remote controller.
 
uint32_t missing_frame = 0
 Number of missing frame.
 

Detailed Description

Signals from remote controller.

The struct contains values of the signals sent by the remote controller.

Member Data Documentation

◆ ch

int16_t RemoteCtrl::ch[NUM_CH_SBUS] = { ZERO_SBUS }

Channels from remote controller.

The array contains values of the channels sent by the remote controller. The size of the array is NUM_CH_SBUS. Current channels are:

  • Channel 1: up/down positoon of the left stick.
  • Channel 2: left/right positoon of the right stick.
  • Channel 3: up/down positoon of the right stick.
  • Channel 4: left/right positoon of the left stick.
  • Channel 5: logic state of the SD switch.
  • Channel 6: logic state of the SE switch.

Values range from MIN_SBUS to MAX_SBUS and are initialized to ZERO_SBUS. For logic channels the low state is MIN_SBUS, while the high state is MAX_SBUS.

Note
Channel type depends on the settings of remote controller.
See also
NUM_CH_SBUS MIN_SBUS MAX_SBUS ZERO_SBUS

◆ missing_frame

uint32_t RemoteCtrl::missing_frame = 0

Number of missing frame.

The counter increment when failing to read SBUS or frame is lost. The counter is reset when reading success. When MAX_MISSING_SBUS is reached, an error is thrown.

See also
MAX_MISSING_SBUS