so hatte es nicht geklappt und ich hatte dann wohl was falsch verstanden:
SystemTools();
so schon, wenn ich auch ziehmlich sicher bin dass das nicht der richtige weg ist
SystemTools(){;};
Eine letzte Frage zu dem Thema habe ich noch.
ich habe nun die Variablen im *.h File definiert. Im *.cpp File wird trotzdem immer bei 0 begonnen, es wird also nicht incrementiert (obwohl sie persistent sind).
#ifndef WS2801_M_h
#define WS2801_M_h
#include <Arduino.h>
#define pixel 31
class WS2801_M{
private:
uint8_t _red;
uint8_t _green;
uint8_t _blue;
public:
struct color {
uint8_t red;
uint8_t green;
uint8_t blue;
};
WS2801_M(){;};
// ++++++++++++++++++ raising edge ++++++++++++++++++++++++++++
void Off(color* buf);
// ++++++++++++++++++++++ GLOW PIXEL +++++++++++++++++++++++++
void Glow(color* buf, bool res, bool trig);
};
#endif
#include "Arduino.h"
#include "WS2801_M.h"
// +++++++++++++++++++++++++ clear all +++++++++++++++++++
void WS2801_M::Off(color* buf) {
color colTmp ={0,0,0};
for (int i = 0; i < pixel; i+=3) {
buf[i] = colTmp;
}
}
// ++++++++++++++++++++++ GLOW PIXEL +++++++++++++++++++++++++
void WS2801_M::Glow(color* buf, bool res, bool trig) {
if(res) {
_red = 0;
_green = 0;
_blue = 0;
Serial.println("RESET");
}
if (trig)
{
if(_red < 254)
{_red= _red+1; Serial.println("INC RED , VAL: " +String(_red));}
else
{_red=0;}
}
for (int i=0; i<pixel; i++){
buf[i].red = _red; // red
buf[i].green = _green; // green
buf[i].blue = _blue; // blue
}
}