Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: neopixel.h
- Revision:
- 16:c3bbd6944a47
- Parent:
- 15:693ce8e6d7f7
- Child:
- 17:ee80b1477af0
--- a/neopixel.h Thu Nov 04 09:20:23 2021 +0000
+++ b/neopixel.h Thu Nov 04 12:55:28 2021 +0000
@@ -25,10 +25,20 @@
while(1);
}
+
+または、
+ strip[0].hex = 0xff0000;
+ strip[1].hex = 0xffff00;
+ strip[2].hex = 0x00ff00;
+ strip[3].hex = 0x00ffff;
+ strip[4].hex = 0x0000ff;
+ strip[5].hex = 0xff00ff;
+
+ npx.send(strip, 6);
+
*/
-
/**
* @brief Struct for easy manipulation of RGB colors.
*
@@ -62,12 +72,12 @@
NeoPixelOut(PinName pin, int num = 0);
- void send(Pixel *colors, uint32_t count, bool flipwait=true);//使用非推奨
- void changeNum(uint32_t num);
+ void send(Pixel *colors, uint32_t count, bool flipwait=true);//pixel変数の配列と個数を渡してLEDに送信する。
+ void changeNum(uint32_t num);//LEDの個数の変更
void setBrightness(float brightness);//0~1
- void setPixelColor(uint32_t i,uint8_t b,uint8_t g,uint8_t r);
+ void setPixelColor(uint32_t i,uint8_t b,uint8_t g,uint8_t r);//rgbそれぞれ個別に明るさを設定する。
void setPixelColor(uint32_t i,uint32_t color);//この関数でそれぞれのLEDの明るさを指定し
- void show();//この関数を呼び出してLEDに信号を送ってください。
+ void show(bool flipwait=true);//この関数を呼び出してLEDに信号を送ってください。
void off(bool flag = true);//LEDを消す。flagは、送信するかしないか。デフォルトでする。
uint32_t color(uint8_t b,uint8_t g,uint8_t r);
int numPixels();//LEDの個数を返す。クラス宣言時に指定した数と同じ。