Giter VIP home page Giter VIP logo

adalight-fastled's People

Contributors

dmadison avatar ladyada avatar paintyourdragon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adalight-fastled's Issues

fastlights rainbow Mode in Ambibox

is it possible to integrate a rainbow mode into the arduino code? as normally available in the fastLED. or is that only possible by creating a profile in ambibox or via a dll?

Can't get to work using Prismatik on WS2812 (non-B) and Elegoo Mega 2650 R3

I've been messing around with this for a little bit in order to get it working with my particular setup and haven't found a way to get it to work. I've got the script set up with the following settings:

// --- General Settings
const uint16_t 
	Num_Leds   =  144;         // strip length
const uint8_t
	Brightness =  255;        // maximum brightness

// --- FastLED Setings
#define LED_TYPE     WS2812  // led strip type for FastLED
#define COLOR_ORDER  GRB      // color order for bitbang
#define PIN_DATA     7        // led data output pin
// #define PIN_CLOCK  7       // led data clock pin (uncomment if you're using a 4-wire LED type)

// --- Serial Settings
const unsigned long
	SerialSpeed    = 115200;  // serial port speed
const uint16_t
	SerialTimeout  = 0;      // time before LEDs are shut off if no data (in seconds), 0 to disable

I've got Prismatik set up as an Ardulight running baud 115200 on COM3 (the port the board is running on.) The board itself has the L light solid and RX light blinking rapidly, I've tried both under screen grabbing and mood light mode. The strip itself is being powered off the 5V line of a 650W PSU. I can run blink.ino with the following (shortened) code just fine:

#include <FastLED.h>
#define NUM_LEDS 144
#define DATA_PIN 7
CRGB leds[NUM_LEDS];
void setup() {FastLED.addLeds<WS2812, DATA_PIN, GRB>(leds, NUM_LEDS);}
void loop() { 
  leds[0] = CRGB::Red;
  FastLED.show();
  delay(500);
  leds[0] = CRGB::Black;
  FastLED.show();
  delay(500);
}

Once reuploading the LEDstream_FastLED code to the board, the TX light blinks once per second, serial monitor shows Ada. As soon as I start Prismatik up, TX light goes off, RX light starts flashing rapidly, but nothing actually happens with the lights (on the strip) themselves.

I don't believe the issue to be an issue with your software, but I've run through everything I can think of and as far as I can tell, everything is functioning...I just don't get the expected result. I know this requires you to take free time to answer. Any help you can give will be appreciated.

Arduino Nano - baud rate

Hi!

I tried to change the baud rate to 460800 for having more FPS, but then the Nano couldn't control the LEDs. I have 103 LEDs and with the baud rate set to 153600, it's working.

I use the Prismatik software on my PC.

request: ultrawide (21:9) color test video

Any chance you could add a version of the Color Test video that is native 21:9 aspect ratio? I've got everything up and working, but would love to have a nice 21:9 demo video to showcase everything.

PS: Thanks for all the work you've done! FastLED seems to fix a few bugs I was running into with a different arduino implementation, and your write up on LED calibration was amazing!

Number of LEDs limited to < 86

Did not work with Prismatik on my Mac- apparently, something must be causing an issue with serial coms. This sketch worked however:
'// Uses Adalight protocol and is compatible with Boblight, Prismatik etc
// "Magic Word" for synchronisation is 'Ada' followed by LED High, Low and Checksum
//
#include <FastLED.h>

///// User definitions /////

// Define the number of LED Controllers
#define NUM_LEDS 135

// Define SPI Pin
#define DATA_PIN 4

// Baudrate, higher rate allows faster refresh rate and more LEDs (defined in /etc/boblight.conf)
#define serialRate 115200

// Adalight sends a "Magic Word" (defined in /etc/boblight.conf) before sending the pixel data
uint8_t prefix[] = {'A', 'd', 'a'}, hi, lo, chk, i;

// initialise LED-array
CRGB leds[NUM_LEDS];

void setup()
{

// Uncomment one of the following lines for your leds arrangement.
// FastLED.addLeds<TM1803, DATA_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<TM1804, DATA_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<TM1809, DATA_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<WS2811, DATA_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<WS2812, DATA_PIN, RGB>(leds, NUM_LEDS);
FastLED.addLeds<WS2812B, DATA_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<UCS1903, DATA_PIN, RGB>(leds, NUM_LEDS);

  // FastLED.addLeds<WS2801, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<SM16716, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<LPD8806, RGB>(leds, NUM_LEDS);

  // FastLED.addLeds<WS2801, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<SM16716, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
  // FastLED.addLeds<LPD8806, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);

// initial RGB flash
LEDS.showColor(CRGB(255, 0, 0));
delay(500);
LEDS.showColor(CRGB(0, 255, 0));
delay(500);
LEDS.showColor(CRGB(0, 0, 255));
delay(500);
LEDS.showColor(CRGB(0, 0, 0));

Serial.begin(serialRate);
Serial.print("Ada\n"); // Send "Magic Word" string to host

}

void loop() {
// wait for first byte of Magic Word
for(i = 0; i < sizeof prefix; ++i) {
waitLoop: while (!Serial.available()) ;;
// Check next byte in Magic Word
if(prefix[i] == Serial.read()) continue;
// otherwise, start over
i = 0;
goto waitLoop;
}

// Hi, Lo, Checksum

while (!Serial.available()) ;;
hi=Serial.read();
while (!Serial.available()) ;;
lo=Serial.read();
while (!Serial.available()) ;;
chk=Serial.read();

// if checksum does not match go back to wait
if (chk != (hi ^ lo ^ 0x55))
{
i=0;
goto waitLoop;
}

memset(leds, 0, NUM_LEDS * sizeof(struct CRGB));
// read the transmission data and set LED values
for (uint8_t i = 0; i < NUM_LEDS; i++) {
byte r, g, b;
while(!Serial.available());
r = Serial.read();
while(!Serial.available());
g = Serial.read();
while(!Serial.available());
b = Serial.read();

//Change Variables to match output if strand is mismatched or try changing order of rgb in controller definition at top

// LED variables r and g swapped to match output of my LED strip-AJ
leds[i].r = g;
leds[i].g = r;
leds[i].b = b;
}
// shows new values
FastLED.show();
}`

Just make sure to uncomment the LED type that you are using.

How to use this code with X/Y coordinate mapped LEDs?

I don't know where "discussion" is.

I was just curious how I could use this with X and Y coordinate mapped LEDs? Like a Fibonacci layout.

I tried: ledsRaw[myMap[outPos++]] = c; // Issue next byte
But that didn't work for me.

Thanks in advance.

fastleds rainbox Mode aus Profile in ambobox

is it possible to integrate a rainbow mode into the arduino code? as normally available in the fastLED. or is that only possible by creating a profile in ambibox or via a dll?

Function prototypes

Please add this to the top of the file, so it can be compiled with platformio:

#include <Arduino.h>

:
:

static void adalight();
static void headerMode();
static void dataMode();
static void dataSet();
static void timeouts();
static void serialFlush();

Script is out of the box not compatible with 4-wire LED strips

Hi there,

Based on your recent recommendation I bought an APA102 ledstrip instead of a WS2812b. At first I tested the strip with some random examples, worked great. Then I wanted to test it as an ambilight strip before I would cut it and start soldering and gluing it to the back of my monitor.

I wanted to load your script onto my arduino, but it threw an error. My APA102 ledstrip contains a clock and data pin and you need to pass both to FastLED.

So instead of just
Led_Pin = 6

You need
Data_Pin = 6
Clock_Pin = 13

And then pass it to FastLED:
FastLED.addLeds<LED_TYPE, Data_Pin, Clock_Pin, COLOR_ORDER>(leds, Num_Leds);

Then the your script seems to work fine with the APA102.

request to finalize the sketch

Please add work with a photoresistor, and add when connecting the board to the computer to blink, the effects are at your discretion, I would also like you to add the smoothness of the leds when you turn on when you run Prismatik.

WS2811 w/ 600 LEDs is not controllable via Arduino Mega

I successfully tested my setup using an Arduino Uno. It was connected to hyperion on a Raspberry Pi 4 (via USB), but was limited to ~400 LEDs due to memory constraints. I therefore swapped in a Mega so that I could run all 600 LEDs in my chain of WS2811s. When I reset the Mega, I do correctly see it blank the lights (which I had enabled in the defines), so I believe wiring and such is correct. I also see the Ada prompts in the Serial Monitor. However, when I attempt to control the Mega via Hyperion / Raspberry Pi, nothing happens (if there's a simpler or more narrowly targeted way to test, I'm all ears).

I have verbose logging turned on in Hyperion, and here's what I see:

Mar 04 18:08:49 deck hyperiond[600]: 2021-03-04T18:08:49.821 hyperiond LEDDEVICE    : <DEBUG> LedDevice.cpp:148:init() | deviceConfig: [{"colorOrder":"rgb","currentLedCount":600,"del
Mar 04 18:08:49 deck hyperiond[600]: 2021-03-04T18:08:49.821 hyperiond LEDDEVICE    : <DEBUG> LedDevice.cpp:407:setLatchTime() | LatchTime updated to 30ms
Mar 04 18:08:49 deck hyperiond[600]: 2021-03-04T18:08:49.822 hyperiond LEDDEVICE    : <DEBUG> LedDevice.cpp:428:setRewriteTime() | Refresh interval = 1000ms
Mar 04 18:08:49 deck hyperiond[600]: 2021-03-04T18:08:49.822 hyperiond LEDDEVICE    : <DEBUG> LedDevice.cpp:434:setRewriteTime() | RewriteTime updated to 1000ms
Mar 04 18:08:49 deck hyperiond[600]: 2021-03-04T18:08:49.822 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:36:init() | DeviceType   : adalight
Mar 04 18:08:49 deck hyperiond[600]: 2021-03-04T18:08:49.822 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:37:init() | LedCount     : 600
Mar 04 18:08:49 deck hyperiond[600]: 2021-03-04T18:08:49.822 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:38:init() | ColorOrder   : rgb
Mar 04 18:08:49 deck hyperiond[600]: 2021-03-04T18:08:49.823 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:39:init() | RefreshTime  : 1000
Mar 04 18:08:49 deck hyperiond[600]: 2021-03-04T18:08:49.823 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:40:init() | LatchTime    : 30
Mar 04 18:08:49 deck hyperiond[600]: 2021-03-04T18:08:49.823 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:52:init() | deviceName   : auto
Mar 04 18:08:49 deck hyperiond[600]: 2021-03-04T18:08:49.823 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:53:init() | AutoDevice   : 1
Mar 04 18:08:49 deck hyperiond[600]: 2021-03-04T18:08:49.823 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:54:init() | baudRate_Hz  : 115200
Mar 04 18:08:49 deck hyperiond[600]: 2021-03-04T18:08:49.823 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:55:init() | delayAfCon ms: 0
Mar 04 18:08:49 deck hyperiond[600]: 2021-03-04T18:08:49.823 hyperiond LEDDEVICE    : <DEBUG> LedDeviceAdalight.cpp:59:init() | Adalight header for 600 leds: Ada 0x02 0x57 0x00
Mar 04 18:08:49 deck hyperiond[600]: 2021-03-04T18:08:49.874 hyperiond LEDDEVICE    : <INFO> found serial device: ttyUSB0
Mar 04 18:08:49 deck hyperiond[600]: 2021-03-04T18:08:49.874 hyperiond LEDDEVICE    : <INFO> Opening UART: ttyUSB0
Mar 04 18:08:49 deck hyperiond[600]: 2021-03-04T18:08:49.874 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:141:tryOpen() | _rs232Port.open(QIODevice::ReadWrite): ttyUSB0, Baud r
Mar 04 18:08:49 deck hyperiond[600]: 2021-03-04T18:08:49.918 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:146:tryOpen() | portName:          ttyUSB0
Mar 04 18:08:49 deck hyperiond[600]: 2021-03-04T18:08:49.918 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:147:tryOpen() | systemLocation:    /dev/ttyUSB0
Mar 04 18:08:49 deck hyperiond[600]: 2021-03-04T18:08:49.918 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:148:tryOpen() | description:       USB2.0-Serial
Mar 04 18:08:49 deck hyperiond[600]: 2021-03-04T18:08:49.918 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:149:tryOpen() | manufacturer:      1a86
Mar 04 18:08:49 deck hyperiond[600]: 2021-03-04T18:08:49.918 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:150:tryOpen() | productIdentifier: 0x7523
Mar 04 18:08:49 deck hyperiond[600]: 2021-03-04T18:08:49.918 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:151:tryOpen() | vendorIdentifier:  0x1a86
Mar 04 18:08:49 deck hyperiond[600]: 2021-03-04T18:08:49.918 hyperiond LEDDEVICE    : <DEBUG> ProviderRs232.cpp:152:tryOpen() | serialNumber:
Mar 04 18:08:49 deck hyperiond[600]: 2021-03-04T18:08:49.926 hyperiond COMPONENTREG : <DEBUG> ComponentRegister.cpp:36:setNewComponentState() | LED device: enabled

The only change I made to the .ino between the Uno and Mega was to change the number of LEDs.

It looks like Hyperion recognizes the USB and is sending messages, but those messages are not being parsed(?). Is there some internal limit I'm hitting? I know FastLED can support thousands of WS28xx... and the Mega has plenty of memory for this (8x that of the Uno, which could almost fit all 600 LEDs).

Flashing randomly

Another user and I have been getting flashing while using with Prismatik, adding the below to the script solves this issue, in case anyone else has the same issue

#define FASTLED_ALLOW_INTERRUPTS 0

Red flash from the strip when arduino wakes upon PC boot.

Hi. First off your write up to make this and your code is awesome. Easy to follow and based on comments on various sections of the build and some comments in the two github repos, I have mine wired up to an 120Hz alienware ultrawide with 120 APA102 LEDS running on an Arduino Pro Micro with a 1,000,000 baud rate able to successfully run them at 15ms. It operates smooth as butter after some confusion on maybe my part as far as the RGB settings and having the LED order reversed in Prismatik. Prismatik had to be set to RGB while BGR was set in arduino to not have R and B swapped. Not sure if I missed that in your write up somewhere.

Anyways. My issue is regarding when the LEDS get woken up from their sleep mode when I turn my PC on and Prismatik connects. The entire strip flash full brightness red for a half second before setting to the correct color. I was hoping there's a way to soften this wakeup transition a bit as its pretty jarring. I'm running on the latest releases of Prismatik and your code. Any other info you need from me let me know and thanks again for making this. Its incredible and far better in my eyes than stuff like Hue or Nanoleaf and at a fraction of the cost.

Not working for me

I bought this kit https://es.aliexpress.com/item/32964959328.html?spm=a2g0s.9042311.0.0.2acd63c0pU1i0x with WS2812B (180 leds). It worked with the original program but I tried to install your code following your instructions and it is not working.

I edited this lines:

static const uint16_t 
	Num_Leds   =  180;   

#define COLOR_ORDER  RGB 

The controller is a Arduino UNO chinese clone.

The FastLED library that I use is "FastLED version 3.001.003".

The ambibox shows: "Device status: connected" and "Adalight: connected" with a "capture speed: 20 FPS" which looks great but LEDs do not turn on...

Do you know what could be the problem? I can suppose that I am not sending the data through the "power" connector but I dont know how to change that.

Error comilation

Hello
When I compile before injecting into the arduino I have this message:

Arduino: 1.0.6 + Td: 1.36 (Windows NT (unknown)), Board: "Teensy 2.0"
C:\Users\MediaPC\Documents\MediaHD.fr\AmbiTV\AmbiTV2\arduino-1.0.6-windows\arduino-1.0.6\hardware\tools\avr\bin\avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega32u4 -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=106 -DTEENSYDUINO=136 -felide-constructors -std=c++0x -DUSB_SERIAL -DLAYOUT_US_ENGLISH -IC:\Users\MediaPC\Documents\MediaHD.fr\AmbiTV\AmbiTV2\arduino-1.0.6-windows\arduino-1.0.6\hardware\teensy\cores\teensy -IC:\Users\MediaPC\Documents\MediaHD.fr\AmbiTV\AmbiTV2\arduino-1.0.6-windows\arduino-1.0.6\libraries\FastLED C:\Users\MediaPC\AppData\Local\Temp\build6836509189643356685.tmp\sketch_sep18a.cpp -o C:\Users\MediaPC\AppData\Local\Temp\build6836509189643356685.tmp\sketch_sep18a.cpp.o 

In file included from LEDstream_FastLED.ino:55:
C:\Users\MediaPC\Documents\MediaHD.fr\AmbiTV\AmbiTV2\arduino-1.0.6-windows\arduino-1.0.6\libraries\FastLED/FastLED.h:19:6: warning: #warning FastLED version 3.001.005 (Not really a warning, just telling you here.)
In file included from C:\Users\MediaPC\Documents\MediaHD.fr\AmbiTV\AmbiTV2\arduino-1.0.6-windows\arduino-1.0.6\libraries\FastLED/FastLED.h:48,
                 from LEDstream_FastLED.ino:55:
C:\Users\MediaPC\Documents\MediaHD.fr\AmbiTV\AmbiTV2\arduino-1.0.6-windows\arduino-1.0.6\libraries\FastLED/fastpin.h:8: warning: expected [error|warning|ignored] after '#pragma GCC diagnostic'
C:\Users\MediaPC\Documents\MediaHD.fr\AmbiTV\AmbiTV2\arduino-1.0.6-windows\arduino-1.0.6\libraries\FastLED/fastpin.h:245: warning: expected [error|warning|ignored] after '#pragma GCC diagnostic'
In file included from C:\Users\MediaPC\Documents\MediaHD.fr\AmbiTV\AmbiTV2\arduino-1.0.6-windows\arduino-1.0.6\libraries\FastLED/FastLED.h:59,
                 from LEDstream_FastLED.ino:55:
C:\Users\MediaPC\Documents\MediaHD.fr\AmbiTV\AmbiTV2\arduino-1.0.6-windows\arduino-1.0.6\libraries\FastLED/pixelset.h:298: error: 'template<class PIXEL_TYPE> class CPixelView' used without template parameters
LEDstream_FastLED.ino: In function 'void serialFlush()':
LEDstream_FastLED.ino:261: warning: unused variable 'r'  

Can you help me please?

Thx

LEDs flicker green on higher framerates, reset to fix

When using Prismatik, a 'Grab Interval' setting of 30 ms or less (>33 fps) will occasionally cause the LEDs to flicker green / cyan on alternating frames. This will persist until the Arduino is reset, regardless of color data being sent.

My assumption is that this is a serial buffer overrun, although I need to do a few tests to confirm and figure-out why it seems to happen sporadically.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.