File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed
Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ This example shows how to interact with NiNa internal memory partition
3+ APIs are modeled on SerialFlash library (not on SD) to speedup operations and avoid buffers.
4+ */
5+
6+ #include < WiFi1010.h>
7+
8+ void setup () {
9+
10+ Serial.begin (115200 );
11+ while (!Serial);
12+
13+ // check for the presence of the shield:
14+ if (WiFi.status () == WL_NO_SHIELD) {
15+ Serial.println (" WiFi shield not present" );
16+ // don't continue:
17+ while (true );
18+ }
19+
20+ WiFiStorageFile file = WiFiStorage.open (" /storage/testfile" );
21+
22+ if (file) {
23+ file.erase ();
24+ }
25+
26+ String test = " Cantami o Diva del pelide Achille" ;
27+ file.write (test.c_str (), test.length ());
28+
29+ if (file) {
30+ file.seek (0 );
31+ while (file.available ()) {
32+ uint8_t buf[128 ];
33+ int ret = file.read (buf, 128 );
34+ Serial.write (buf, ret);
35+ }
36+ }
37+ }
38+
39+ void loop () {
40+ // put your main code here, to run repeatedly:
41+
42+ }
You can’t perform that action at this time.
0 commit comments