Skip to content

File rgb_led.h

File List > external-docs > libDaisy > src > hid > rgb_led.h

Go to the documentation of this file

Source Code

#pragma once
#ifndef DSY_RGB_LED_H
#define DSY_RGB_LED_H
#include "hid/led.h"
#include "util/color.h"

namespace daisy
{
class RgbLed
{
  public:
    RgbLed() {}
    ~RgbLed() {}

    void Init(Pin red, Pin green, Pin blue, bool invert);

    void Set(float r, float g, float b);

    void SetRed(float val);

    void SetGreen(float val);

    void SetBlue(float val);

    void SetColor(Color c);

    void Update();

  private:
    Led r_, g_, b_;
};
} // namespace daisy

#endif