Noiasca Tool Kit
Several helper functions and classes to make life with Arduino easier
Public Member Functions | List of all members
TrafficlightPCA9685 Class Reference

a Traffic light with 3 PCA9685 outputs More...

#include <Noiasca_PCA9685.h>

Inheritance diagram for TrafficlightPCA9685:
Trafficlight< PCA9685Group< 3 > >

Public Member Functions

 TrafficlightPCA9685 (Adafruit_PWMServoDriver &pwm, byte pixelA, byte pixelB, byte pixelC)
 
- Public Member Functions inherited from Trafficlight< PCA9685Group< 3 > >
 Trafficlight (PCA9685Group< 3 > &obj)
 constructor for a traffic light More...
 
void begin ()
 start hardware More...
 
void setInterval (uint16_t _on)
 set on times More...
 
int setSequenceIndex (uint8_t index, uint8_t newState, uint16_t newInterval)
 set the sequence parameters More...
 
int setSequenceMax (uint8_t newMax)
 set the number of sequences More...
 
void setMode (Mode newMode)
 set the current Mode of the traffic light More...
 
void setOnStateChange (Callback funcPtr)
 set the callback function onStateChange More...
 
void setOnSequenceChange (Callback funcPtr)
 set the callback function onSequnceChange More...
 
void setOnColor (uint16_t actual, uint32_t _on)
 set the color for a traffic light More...
 
void setOffColor (uint32_t _off)
 set the color for a traffic light More...
 
void setState (uint8_t newState)
 set the state of the traffic light More...
 
void update (uint32_t currentMillis=millis())
 check if update is necessary More...
 

Detailed Description

a Traffic light with 3 PCA9685 outputs

wrapper for a traffic light with 3 PCA9685 outputs. Inherits "style" class and composites PCA9685.

Note
don't forget to set colors for the three pca9685s (e.g. red, yellow, green).

Constructor & Destructor Documentation

◆ TrafficlightPCA9685()

TrafficlightPCA9685::TrafficlightPCA9685 ( Adafruit_PWMServoDriver &  pwm,
byte  pixelA,
byte  pixelB,
byte  pixelC 
)
inline
Parameters
pwma reference to your pwm object
pixelAthe pixel on the pwm to be used for red
pixelBthe pixel on the pwm to be used for yellow
pixelCthe pixel on the pwm to be used for green