MetaWear C++ API  0.18.0
C++ implementation of the MetaWear protocol
Classes | Enumerations | Functions | Variables
led.h File Reference

Communicates with the ultra-bright LED. More...

#include "peripheral_common.h"

Go to the source code of this file.

Classes

struct  MblMwLedPattern
 Attributes describing a light pulse. More...
 

Enumerations

enum  MblMwLedColor { MBL_MW_LED_COLOR_GREEN, MBL_MW_LED_COLOR_RED, MBL_MW_LED_COLOR_BLUE }
 Available colors on the LED.
 
enum  MblMwLedPreset { MBL_MW_LED_PRESET_BLINK, MBL_MW_LED_PRESET_PULSE, MBL_MW_LED_PRESET_SOLID }
 Enumeration of preset patterns available in the library Patterns are based on the led blog post, http://projects.mbientlab.com/?p=656.
 

Functions

METAWEAR_API void mbl_mw_led_load_preset_pattern (MblMwLedPattern *pattern, MblMwLedPreset preset)
 Loads the struct with a preset configuration. More...
 
METAWEAR_API void mbl_mw_led_write_pattern (const MblMwMetaWearBoard *board, const MblMwLedPattern *pattern, MblMwLedColor color)
 Writes the led pattern to the board. More...
 
METAWEAR_API void mbl_mw_led_autoplay (const MblMwMetaWearBoard *board)
 Plays any programmed patterns, and immediately plays any patterns programmed later. More...
 
METAWEAR_API void mbl_mw_led_play (const MblMwMetaWearBoard *board)
 Plays any programmed patterns. More...
 
METAWEAR_API void mbl_mw_led_pause (const MblMwMetaWearBoard *board)
 Pauses the patterns. More...
 
METAWEAR_API void mbl_mw_led_stop (const MblMwMetaWearBoard *board)
 Stops playing LED patterns. More...
 
METAWEAR_API void mbl_mw_led_stop_and_clear (const MblMwMetaWearBoard *board)
 Stops playing LED patterns and clears all pattern configurations. More...
 

Variables

const uint8_t MBL_MW_LED_REPEAT_INDEFINITELY = 0xff
 Value indicating the led pulse will repeat indefinitely.
 

Detailed Description

Communicates with the ultra-bright LED.

Function Documentation

◆ mbl_mw_led_autoplay()

METAWEAR_API void mbl_mw_led_autoplay ( const MblMwMetaWearBoard board)

Plays any programmed patterns, and immediately plays any patterns programmed later.

Parameters
boardPointer to the board to send the command to

◆ mbl_mw_led_load_preset_pattern()

METAWEAR_API void mbl_mw_led_load_preset_pattern ( MblMwLedPattern pattern,
MblMwLedPreset  preset 
)

Loads the struct with a preset configuration.

Parameters
patternPointer to the pattern to write the configuration to
presetPreset pattern to load

◆ mbl_mw_led_pause()

METAWEAR_API void mbl_mw_led_pause ( const MblMwMetaWearBoard board)

Pauses the patterns.

Parameters
boardPointer to the board to send the command to

◆ mbl_mw_led_play()

METAWEAR_API void mbl_mw_led_play ( const MblMwMetaWearBoard board)

Plays any programmed patterns.

Parameters
boardPointer to the board to send the command to

◆ mbl_mw_led_stop()

METAWEAR_API void mbl_mw_led_stop ( const MblMwMetaWearBoard board)

Stops playing LED patterns.

Parameters
boardPointer to the board to send the command to

◆ mbl_mw_led_stop_and_clear()

METAWEAR_API void mbl_mw_led_stop_and_clear ( const MblMwMetaWearBoard board)

Stops playing LED patterns and clears all pattern configurations.

Parameters
boardPointer to the board to send the command to

◆ mbl_mw_led_write_pattern()

METAWEAR_API void mbl_mw_led_write_pattern ( const MblMwMetaWearBoard board,
const MblMwLedPattern pattern,
MblMwLedColor  color 
)

Writes the led pattern to the board.

Parameters
boardPointer to the board to send the command to
patternPointer to the pattern attributes to write to the board
colorColor the pattern is configuring