問題タブ [fastled]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
2 に答える
429 参照

c++ - Error to create header file and use CRGB LED array from FastLED library

I'm working on Arduino project with addressable LEDs and I'm using the FastLED.h library.

To simplify my program, I want to create a library called LedsHorloge.h from which one I'll call the function Jauge(int tour, int numberLeds, int brightness, CRGB* ledTable) to light up my LED strip.

I'm newbie in C++.

In the Arduino IDE, this is the error I get:

#xA;

This error happens when I run this code in the Arduino IDE:

#xA;

This is my header called LedsHorloge.h

#xA;

This is my source code called LedsHorloge.cpp

#xA;

I don't know how to make a pointer on the object CRGB leds[NUMBER_LEDS];.

0 投票する
4 に答える
580 参照

c++ - この for ループはプリプロセッサで実行できますか?

私のコードは、テンプレート化された関数を使用するライブラリ (FastLED) を使用します。

テンプレート引数はコンパイル時に計算可能である必要があるため、これを通常の for ループに入れることはできません。プリプロセッサでこれを行うことはできますか? 他の提案はありますか?これらの行をコピーして貼り付けることなく、NUM_WIDGETS を便利に変更できるようにしたいと考えています。