Loom 4 v4.5
Arduino library for Internet of Things Rapid Prototyping in environmental sensing
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Loom_Neopixel Class Reference

#include <Loom_Neopixel.h>

Inheritance diagram for Loom_Neopixel:
Inheritance graph
[legend]
Collaboration diagram for Loom_Neopixel:
Collaboration graph
[legend]

Public Member Functions

 Loom_Neopixel (Manager &man, const bool enableA0=false, const bool enableA1=false, const bool enableA2=true, const neoPixelType colorType=NEO_RGB)
 
 Loom_Neopixel (const bool enableA0=false, const bool enableA1=false, const bool enableA2=true, const neoPixelType colorType=NEO_RGB)
 
void initialize () override
 
void package (JsonObject json) override
 
void control (JsonArray json) override
 
void set_color (const uint8_t port, const uint8_t chain_num, const uint8_t red, const uint8_t green, const uint8_t blue)
 
void enable_pin (const uint8_t port, const bool state)
 
- Public Member Functions inherited from Actuator
 Actuator (ACTUATOR_TYPE actType, int instance)
 
virtual void initialize ()=0
 
virtual void package (JsonObject json)=0
 
virtual void control (JsonArray json)=0
 
void printModuleName (const char *message) override
 
const char * getModuleName () override
 
const char * typeToString ()
 
int get_instance_num ()
 
- Public Member Functions inherited from Module
 Module (const char *modName)
 
void setModuleName (const char *modName)
 
virtual const char * getModuleName ()
 
virtual void printModuleName (const char *message)
 
virtual void initialize ()=0
 
virtual void measure ()=0
 
virtual void package ()=0
 
virtual void power_up ()=0
 
virtual void power_down ()=0
 
virtual void display_data ()
 

Additional Inherited Members

- Public Attributes inherited from Module
bool moduleInitialized = true
 
int module_address = -1
 
- Protected Member Functions inherited from Actuator
void measure () override
 
void power_up () override
 
void power_down () override
 
void package () override
 

Detailed Description

Neopixel LED Strip Controller

Author
Will Richards

Constructor & Destructor Documentation

◆ Loom_Neopixel() [1/2]

Loom_Neopixel::Loom_Neopixel ( Manager man,
const bool  enableA0 = false,
const bool  enableA1 = false,
const bool  enableA2 = true,
const neoPixelType  colorType = NEO_RGB 
)

Constructs a new Neopixel instance

Parameters
manReference to the manager
enableA0Enable the first Neopixel
enableA1Enable the second Neopixel
enableA2Enable the third Neopixel
colorTypespecify the color configuration of the neopixel

◆ Loom_Neopixel() [2/2]

Loom_Neopixel::Loom_Neopixel ( const bool  enableA0 = false,
const bool  enableA1 = false,
const bool  enableA2 = true,
const neoPixelType  colorType = NEO_RGB 
)

Constructs a new Neopixel instance

Parameters
enableA0Enable the first Neopixel
enableA1Enable the second Neopixel
enableA2Enable the third Neopixel
colorTypespecify the color configuration of the neopixel

Member Function Documentation

◆ control()

void Loom_Neopixel::control ( JsonArray  json)
overridevirtual

Called when a packet is received that needs to move the actuator

Parameters
jsonThe parameters that can change

Implements Actuator.

◆ enable_pin()

void Loom_Neopixel::enable_pin ( const uint8_t  port,
const bool  state 
)

Enable or disable a given Neopixel pin

Parameters
portPort that we want to change (A0-A2)
stateState that we want to change the port too

◆ initialize()

void Loom_Neopixel::initialize ( )
overridevirtual

Implements Actuator.

◆ package()

void Loom_Neopixel::package ( JsonObject  json)
overridevirtual

Implements Actuator.

◆ set_color()

void Loom_Neopixel::set_color ( const uint8_t  port,
const uint8_t  chain_num,
const uint8_t  red,
const uint8_t  green,
const uint8_t  blue 
)

Manually set the color of a specific Neopixel

Parameters
portThe port of the neopixel we want to control (0 - 2)
chain_numThe number of the neopixel if daisy chained
redThe red value (0-255)
greenThe green value (0-255)
blueThe blue value (0-255)

The documentation for this class was generated from the following files: