driver status, setup, stop

This commit is contained in:
2019-07-19 13:52:52 +03:00
parent a24e56e941
commit fb64394571
6 changed files with 60 additions and 8 deletions

View File

@@ -7,16 +7,33 @@
#include "FastLED.h"
#define NUM_LEDS 60
#define DATA_PIN 11
#define DATA_PIN 4
CRGB leds[NUM_LEDS];
static int driverStatus = CST_UNKNOWN;
int out_SPILed::Setup()
{
Serial.println("SPI-LED Init");
FastLED.addLeds<TM1809, DATA_PIN, BRG>(leds, NUM_LEDS);
driverStatus = CST_INITIALIZED;
return 1;
}
int out_SPILed::Stop()
{
Serial.println("SPI-LED De-Init");
FastLED.addLeds<TM1809, DATA_PIN, BRG>(leds, NUM_LEDS);
driverStatus = CST_UNKNOWN;
return 1;
}
int out_SPILed::Status()
{
return driverStatus;
}
int out_SPILed::Poll()
{
FastLED.show();
@@ -32,7 +49,7 @@ if (subItem)
from=atoi(subItem);
to=from;
}
debugSerial<<from<<F("-")<<to<<F(" cmd=")<<cmd<<endl;
for (n=from;n<=to;n++)
{

View File

@@ -9,7 +9,9 @@ public:
out_SPILed(Item * _item):abstractOut(_item){};
int Setup() override;
int Poll() override;
virtual int Ctrl(short cmd, short n=0, int * Parameters=NULL, boolean send=true, int suffixCode=0, char* subItem=NULL) override;
int Stop() override;
int Status() override;
int Ctrl(short cmd, short n=0, int * Parameters=NULL, boolean send=true, int suffixCode=0, char* subItem=NULL) override;
protected:
};