53 lines
1016 B
C++
53 lines
1016 B
C++
#ifndef __GUNIOR_PIO
|
|
#define __GUNIOR_PIO
|
|
|
|
#include <Arduino.h>
|
|
|
|
#define SEKUNDE * 1000.0
|
|
#define SEKUNDEN * 1000.0
|
|
|
|
#define ROT {255, 0, 0}
|
|
#define GRUEN {0, 255, 0}
|
|
#define BLAU {0, 0, 255}
|
|
#define GELB {255, 255, 0}
|
|
#define ORANGE {255, 64, 0}
|
|
#define LILA {255, 0, 255}
|
|
#define CYAN {0, 255, 255}
|
|
#define WEISS {255, 255, 255}
|
|
|
|
typedef struct {
|
|
uint8_t rot;
|
|
uint8_t gruen;
|
|
uint8_t blau;
|
|
} Farbe;
|
|
|
|
class RGB_LED
|
|
{
|
|
const uint8_t red;
|
|
const uint8_t green;
|
|
const uint8_t blue;
|
|
|
|
public:
|
|
RGB_LED(const uint8_t& pin_rot, const uint8_t& pin_gruen, const uint8_t pin_blau);
|
|
|
|
void start();
|
|
|
|
void stell_farbe_ein(const Farbe& farbe);
|
|
|
|
void stell_farbe_ein(const uint8_t& rot, const uint8_t& gruen, const uint8_t& blau);
|
|
};
|
|
|
|
void schalte_pin_an(const uint8_t& pin);
|
|
|
|
void schalte_pin_aus(const uint8_t& pin);
|
|
|
|
void mache_pin_zu_schalter(const uint8_t& pin);
|
|
|
|
void mache_pin_zu_sensor(const uint8_t& pin);
|
|
|
|
void warte(const float& millisekunden);
|
|
|
|
void regel_pin(const uint8_t& pin, const float& staerke);
|
|
|
|
#endif
|