mirror of
https://github.com/anklimov/lighthub
synced 2025-12-09 13:19:50 +03:00
driver status, setup, stop
This commit is contained in:
@@ -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++)
|
||||
{
|
||||
|
||||
|
||||
@@ -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:
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user