Clone
13
Led control
atc1441 edited this page 2025-05-21 09:40:43 +02:00

The led of NRF based tags can be controlled by sending a command with the id 4 to the tag.

The led is controlled by the extended command data(12 Bytes)

The first Byte is split into two parts:

the second 4 bits will describe the mode of the led control. The interpretation of the following bytes changes per mode.

the first 4 bits are the duration of the led flashes in millisecond where 0 is mapped to half a ms and 15 is mapped to no off time. 15 WILL RUIN YOUR BATTERY LIFE. Everything higher than 3ms has a diminishing effect to visibility and 2ms is recommended as the bes compromise between power consumption and visibility.

You can send this pattern as a http GET to /led_flash?mac=000000000000&pattern=000000000000000000000000 To stop a running pattern, send an empty pattern: /led_flash?mac=000000000000

MODE 0 LED sequence OFF

MODE 1 advanced sequence control

2120530A20530A20530A0A00

meaning:

2----------------------- flash duration (ms; see above)

-1---------------------- mode: 1: advanced sequence control

--20-------------------- group 1: color in rgb 332 (rrrgggbb)

----5------------------- group 1: flash speed (x100 ms)

-----3------------------ group 1: amount of flashes

------0A---------------- group 1: delay after this flash group (x100 ms)

--------20-------------- group 2: color in rgb 332 (rrrgggbb)

----------5------------- group 2: flash speed (x100 ms)

-----------3------------ group 2: amount of flashes

------------0A---------- group 2: delay after this flash group (seconds)

--------------20-------- group 3: color in rgb 332 (rrrgggbb)

----------------5------- group 3: flash speed (x100 ms)

-----------------3------ group 3: amount of flashes

------------------0A---- group 3: delay after this flash group (seconds)

--------------------0A-- repeats: how often to repeat sequence of group 1..3

----------------------00 spare, always 00

MODE 2 - 15 are reserved for future use and are used for off at the moment