# saveStrings not declared in scope

**URL:** <https://forum.arduino.cc/t/savestrings-not-declared-in-scope/1439348>\
**Category:** Programming\
**Created:** [April 10, 2026, 7:10pm UTC](https://forum.arduino.cc/t/savestrings-not-declared-in-scope/1439348 "2026-04-10T19:10:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Piethon](https://avatars.discourse-cdn.com/v4/letter/p/94ad74/32.png) [@Piethon](https://forum.arduino.cc/u/Piethon)\
**Post date:** [April 10, 2026, 7:10pm UTC](https://forum.arduino.cc/t/savestrings-not-declared-in-scope/1439348/1 "2026-04-10T19:10:31Z")

</div>

I have a simple program - I’m trying to just log some temperatrues from a sensor, and saw saveStrings() is a thing. However, it throws an error, “Compilation error: saveStrings’ was not declared in this scope.

Here’s the code (and I also have `temperature.txt` saved in the program folder.

```arduino
#include <Adafruit_MLX90614.h>
#define LED 13
const int piezoPin = 8;
String temp = "test";
Adafruit_MLX90614 mlx = Adafruit_MLX90614();

void setup() {
    Serial.begin(9600);
    pinMode(LED, OUTPUT);
    while (!Serial);
    if (!mlx.begin()) {
        Serial.println("Error connecting to MLX sensor. Check wiring.");
        while (1);
    };
}
 
void loop() {
    // Serial.print("Ambient = "); Serial.print(mlx.readAmbientTempC());
    // Serial.print("*C\tObject = "); Serial.print(mlx.readObjectTempC()); Serial.println("*C");
    Serial.print("Ambient = "); Serial.print(mlx.readAmbientTempF());
    Serial.print("*F\tObject = "); Serial.print(mlx.readObjectTempF()); Serial.println("*F");
    temp = mlx.readObjectTempF();

// ERROR IS ON THE BELOW LINE
    saveStrings("temperature.txt", temp);
    Serial.println();
    if(mlx.readObjectTempF() > 80){
        digitalWrite(LED, HIGH);
        tone(piezoPin, 1000, 100);
        digitalWrite(piezoPin, LOW);
    } else {
        digitalWrite(LED, LOW);
        // notone(piezoPin);
        digitalWrite(piezoPin, HIGH);
    }
    // delay(500);
    delay(60000); // delay 1 minute
}

```

I can’t see why, the example on the Arduino page is quite simple?

> **[saveStrings() / Reference](https://processing.org/reference/savestrings_)**
>
> Writes an array of Strings to a file, one line per String. By default, this file is saved to the sketch's folder. This folder is opened by selecting "Show Sketch Folder" from the "Sketch" menu. \<…

---

<div class="post-metadata">

**Author:** ![MaximoEsfuerzo](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/maximoesfuerzo/32/923798_2.png) [@MaximoEsfuerzo](https://forum.arduino.cc/u/MaximoEsfuerzo)\
**Post date:** [April 10, 2026, 7:30pm UTC](https://forum.arduino.cc/t/savestrings-not-declared-in-scope/1439348/2 "2026-04-10T19:30:22Z")

</div>

Perhaps the problem is that you are using the Processing reference instead of the Arduino reference.  
Arduino does not include the `saveStrings()` function.

---

<div class="post-metadata">

**Author:** ![sonofcy](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sonofcy/32/1283617_2.png) [@sonofcy](https://forum.arduino.cc/u/sonofcy)\
**Post date:** [April 10, 2026, 8:11pm UTC](https://forum.arduino.cc/t/savestrings-not-declared-in-scope/1439348/3 "2026-04-10T20:11:03Z")

</div>

> [@Piethon](#):
>
> example on the Arduino page

What page is that?

---

<div class="post-metadata">

**Author:** ![Piethon](https://avatars.discourse-cdn.com/v4/letter/p/94ad74/32.png) [@Piethon](https://forum.arduino.cc/u/Piethon)\
**Post date:** [April 10, 2026, 8:20pm UTC](https://forum.arduino.cc/t/savestrings-not-declared-in-scope/1439348/4 "2026-04-10T20:20:09Z")

</div>

Whelp I’m an idiot haha. Thanks.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [October 7, 2026, 8:20pm UTC](https://forum.arduino.cc/t/savestrings-not-declared-in-scope/1439348/5 "2026-10-07T20:20:55Z")

</div>

Closed on October 7, 2026, 8:20pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
