mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-08-09 23:54:41 +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
|
||||
|
||||
int leds[MAX_LED_COUNT];
|
||||
int ledCount = 0;
|
||||
|
||||
for(int led : root["leds"].asArray()) {
|
||||
leds[ledCount++] = led;
|
||||
if (ledCount >= MAX_LED_COUNT) break;
|
||||
}
|
||||
int ledCount = root["leds"].asArray().copyTo(leds);
|
||||
```
|
||||
|
||||
See issue [#246](https://github.com/bblanchon/ArduinoJson/issues/246)
|
||||
|
Reference in New Issue
Block a user