saveStrings to non-local file

edited February 2017 in Arduino

I can loadStrings() from a website location but when I try saveStrings() I get an error. Is there a way to write to a text file that's not on my local drive? In the example below it processes the loadStrings() command just fine but errors on the saveStrings(). In reality I don't need to read, only write. loadStrings() and println() are only in there for testing.

Edit: In the actual code, "website" is the full http path to the text file. For some reason it was showing correctly in the preview but not in the submitted post.

import processing.serial.*;
import cc.arduino.*;

Arduino arduino;

void setup() {
  println(Arduino.list());
  arduino = new Arduino(this, Arduino.list()[2], 57600);
}

void draw() {
  String[] textData = new String[4];
  String[] readTextData = new String[4];
  float temperature = arduino.analogRead(1);
  temperature = (temperature * .004882814);
  temperature = (temperature - .5) * 100;
  temperature = (temperature * 1.8) +32;
  //println(temperature);
  float tankLevel = arduino.analogRead(0);
  tankLevel = (tankLevel - 32) / 991 * 4;
  //println(tankLevel);
  textData[0] = "Tank Level - " + tankLevel + "'";
  textData[1] = "Tank Temp - " + temperature +"F";
  readTextData = loadStrings("website/text.txt");
  println(readTextData[1]);
  saveStrings("website/text.txt", textData);
  delay(5000);
}
Sign In or Register to comment.