File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,11 +31,27 @@ int age = storage.get<int>("age");
3131float temperature = storage.get<float >(" temperature" );
3232bool isSwitchOn = storage.get<bool >(" switch_state" );
3333```
34- 3 . Add values to an array in the server.
34+ 3 . Add values to an array in the server
3535``` C++
3636storage.add<float >(" sensor_values" , getCurrentSensorValue());
3737storage.add<String>(" startup_dates" , " 17.12.2018" );
3838```
39+ 4 . Pop values from an array in the server
40+ ``` C++
41+ String color = storage.pop<String>(" colors_to_show" , PopFrom_End);
42+ float temp = storage.pop<float >(" tempertures" , PopFrom_Start);
43+ ```
44+ ``` C++
45+ // More advanced example of pop. In the previous example the returned value is
46+ // implicitly casted into the required return type (String, float etc..)
47+ while (true ) {
48+ auto popResult = storage.pop<String >("lines_to_print", PopFrom_Start);
49+ if(popResult.isOK == false) break;
50+ proccessLine (popResult.value);
51+ if(popResult.hasNext == false) break;
52+ }
53+ ```
54+
3955
4056# Requirements
4157* This library uses the ` ArduinoJson ` library as a depedency.
You can’t perform that action at this time.
0 commit comments