> For the complete documentation index, see [llms.txt](https://ubtechedu.gitbook.io/ukit-explore/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ubtechedu.gitbook.io/ukit-explore/standard/sensor/eyelight/seteyelightpetals.md).

# setEyelightPetals(id,petalsnum,petals)

### Parameter

| Parameters | Type          | Description                                                                                                                                          |
| ---------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| id         | unsigned char | ID number to be controlled, range 0 \~ 10                                                                                                            |
| petalsnum  | int           | Number of light petals (pixels) to be lit, range 0 \~ 8, default is 8                                                                                |
| petals     | int           | Set the color of each light petal. Fill in a fixed Json format {“data” \[first lamp petal number, r, g, b, second lamp petal number, r, g, b, ....]} |

### Json

{“Data” \[First lamp petal number, r, g, b, second lamp petal number, r, g, b, ..., eighth lamp petal number, r, g, b ,]} Each light bulb of the eye light has a fixed number.

![](/files/-M5QqcS0kwvNy0wAh1ik)

### Example

Use the ukitexplore V2 board to control the ID-1 eye light to be on, as shown in the above figure:

```c
#include "uKitExplore2.h"

String colours_json;

void setup() {    
    Initialization();
   
}

void loop() {    
    colours_json = "{\"data\":\
        [1, 0, 0, 0,\        
        2, 255, 255, 255,\        
        4, 255, 240, 0,\        
        8, 0, 255, 0,\        
        16, 255, 0, 0,\        
        32, 0, 0, 255,\        
        64, 255, 0, 255,\        
        128, 255, 255, 255]}";    
    setEyelightPetals(1, 8, colours_json);
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ubtechedu.gitbook.io/ukit-explore/standard/sensor/eyelight/seteyelightpetals.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
