Skip to content

Commit 5ddaa6b

Browse files
authored
Update README.md
1 parent 9b9084f commit 5ddaa6b

1 file changed

Lines changed: 29 additions & 4 deletions

File tree

README.md

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ Easily configure your control pad to support network protocols such as **Bluetoo
2626

2727
3. **Switch Connection Type Anytime**
2828
You can change the connection type of a control pad at any time without creating a duplicate for a different connection.
29+
30+
4. **Update UI From your Script**
31+
You can change the state of SWITCH,SLIDER and LED from your script
32+
2933

3034
## Supported Components
3135
1. Switch
@@ -34,7 +38,8 @@ Easily configure your control pad to support network protocols such as **Bluetoo
3438
4. DPAD
3539
5. Joystick
3640
6. Steering Wheel
37-
7. Accelerometer and Gyroscope (If supported by the device)
41+
7. LED
42+
8. Accelerometer and Gyroscope (If supported by the device)
3843

3944
## How It Works (4 steps)
4045

@@ -182,6 +187,22 @@ For **Bluetooth** and **Bluetooth LE** connections, dragging the slider thumb ge
182187

183188
---
184189

190+
### **LED**
191+
To update the LED, send the following JSON message to the app:
192+
```json
193+
{
194+
"id": "the id you specified",
195+
"type": "LED",
196+
"state": "ON"
197+
}
198+
```
199+
- `state` accepts the following values:
200+
201+
- `"ON"` – Turns the LED on
202+
- `"OFF"` – Turns the LED off
203+
- `"BLINK"` – Makes the LED blink
204+
205+
185206
## Sensor Readings
186207

187208
![image](https://github.com/user-attachments/assets/eeb83142-342e-4cfb-974e-4fd45563dd1d)
@@ -231,9 +252,13 @@ For **Bluetooth** and **Bluetooth LE** : `GYROSCOPE,<x>,<y>,<z>`
231252

232253
## Sending JSON Messages to DroidPad
233254

234-
You can send JSON messages to DroidPad to update the UI. Currently, only **SWITCH** and **SLIDER** can be updated. All connection types are supported except for **BLE**.
255+
You can send JSON messages to DroidPad to update the UI. All connection types are supported except for **BLE**. You can update following component
256+
257+
- SWITCH
258+
- SLIDER
259+
- LED
235260

236-
To update a **SWITCH** or a **SLIDER**, send a JSON object message similar to the ones specified in the [SWITCH](#switch) and [SLIDER](#slider) sections, with the desired value or state.
261+
To update a **SWITCH**, **SLIDER** or **LED** send a JSON object message similar to the ones specified in the [SWITCH](#switch), [SLIDER](#slider) and [LED](#led) sections, with the desired value or state.
237262

238263
For **Bluetooth Classic** and **TCP** connections, you must send each JSON message on a new line. This is because DroidPad reads the incoming stream line by line. Each JSON message should be on a single line, and multiple messages should be separated by a line feed (`\n`).
239264

@@ -243,7 +268,7 @@ For example:
243268
{"id":"s1","type":"SLIDER","value":1.4}\n{"id":"s1","type":"SLIDER","value":1.5}\n{"id":"s1","type":"SLIDER","value":1.4}
244269
```
245270

246-
For **MQTT**, **WebSocket**, and **UDP** connections, you can send formatted JSON without the one-line and line feed restrictions, as these are message-based protocols.
271+
For **MQTT**, **WebSocket**, and **UDP** connections, you can send formatted JSON without the one-line and line feed restrictions, as these are message-based protocols. For **MQTT** you have to publish to `DroidPad/feed` topic
247272

248273

249274
## Important Note for Bluetooth and Bluetooth Low Energy

0 commit comments

Comments
 (0)