With return character:
#include <Process.h>
void setup() {
Bridge.begin(); // Initialize Bridge
}
void loop() {
int temperature = random(0, 100);
Process p;
p.begin("/mnt/sda1/db.php");
p.addParameter(String(temperature));
while (p.running());
while (p.available()) {
char c = p.read();
Serial.print(c);
}
delay(1000);
}
With return integer:
#include <Process.h>
void setup() {
Bridge.begin(); // Initialize Bridge
}
void loop() {
int temperature = random(0, 100);
Process p;
p.begin("/mnt/sda1/db.php");
p.addParameter(String(temperature));
while (p.running());
while (p.available()) {
int result = p.parseInt(); // look for an integer
Serial.println(result); // print the number as well
}
delay(1000);
}
Comments powered by CComment