This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Grove WS2812 LED Strip
Ten Wong edited this page Jun 8, 2016
·
1 revision
The Grove WS2812 LED Strip is a full-color that external control for each lamp beads. It with high brightness, can achieve effects of full color running water, chasing and scan.
Set or reset or clear the led strip with a specified color.
Request method: POST
Arguments in URL:
[total_led_cnt]: uint8_t value, the total count of this strip, max: 60(too many leds will cause the power unstable)
[rgb_hex_string]: char * value, a rgb value in hex format, e.g. AA55CC (without # or 0x)
Returns:
HTTP 200 {"result": "OK"}
HTTP 400 {"error": "failure reason here"}
Curl example:
curl -k -X POST https://iot.seeed.cc/v1/node/GroveLedWs2812D0/clear/10/008000?access_token=328d1638a200ed4a1f50623307cc1905
Response:
{"result": "ok"}
Change the color of some piece of segment of the led strip. We need to specify a list of rgb hex value concatinated into a string. The segment will be defined with a start index and the length. The length equals rgb_hex_string's length / 6.
Request method: POST
Arguments in URL:
[start]: uint8_t value, the start index of the segment(included)
[rgb_hex_string]: char * value, a list of rgb hex value, e.g. FFFFFFBBBBBBCCCCCC000000111111, max length: 240 or 40 rgb hex
Returns:
HTTP 200 {"result": "OK"}
HTTP 400 {"error": "failure reason here"}
Curl example:
curl -k -X POST https://iot.seeed.cc/v1/node/GroveLedWs2812D0/segment/0/800000008000000080?access_token=328d1638a200ed4a1f50623307cc1905
Response:
{"result": "ok"}
Make the strip blink in a rainbow flow
Request method: POST
Arguments in URL:
[length]: uint8_t value, the length of the flow, the flow will always begin with index 0.
[brightness]: uint8_t value, 0~100
[speed]: uint8_t value, 1~10, 10 is the fastest.
Returns:
HTTP 200 {"result": "OK"}
HTTP 400 {"error": "failure reason here"}
Curl example:
curl -k -X POST https://iot.seeed.cc/v1/node/GroveLedWs2812D0/start_rainbow_flow/30/50/5?access_token=328d1638a200ed4a1f50623307cc1905
Response:
{"result": "ok"}
Stop the rainbow flow.
Request method: POST
Returns:
HTTP 200 {"result": "OK"}
HTTP 400 {"error": "failure reason here"}
Curl example:
curl -k -X POST https://iot.seeed.cc/v1/node/GroveLedWs2812D0/stop_rainbow_flow?access_token=328d1638a200ed4a1f50623307cc1905
Response:
{"result": "ok"}