mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-08-10 16:14:44 +02:00
Updated Bag of Tricks (markdown)
@@ -14,12 +14,7 @@ And we want to get a `int[]` out of it:
|
|||||||
#define MAX_LED_COUNT 10
|
#define MAX_LED_COUNT 10
|
||||||
|
|
||||||
int leds[MAX_LED_COUNT];
|
int leds[MAX_LED_COUNT];
|
||||||
int ledCount = 0;
|
int ledCount = root["leds"].asArray().copyTo(leds);
|
||||||
|
|
||||||
for(int led : root["leds"].asArray()) {
|
|
||||||
leds[ledCount++] = led;
|
|
||||||
if (ledCount >= MAX_LED_COUNT) break;
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
See issue [#246](https://github.com/bblanchon/ArduinoJson/issues/246)
|
See issue [#246](https://github.com/bblanchon/ArduinoJson/issues/246)
|
||||||
|
Reference in New Issue
Block a user