// Zweizelgaenger Zeiger Liebesbarometer
#include <Api.h>
#include <Audio.h>
#include <BufferedStream.h>
#include <digitalWriteFast.h>
#include <Download.h>
#include <ExtendedStream.h>
#include <HttpClient.h>
#include <JsonStream.h>
#include <PusherClient.h>
#include <SerialStream.h>
#include <Sha256.h>
#include <StatusLed.h>
#include <Vs1011.h>
#include <Wifly.h>
#include <SdFat.h>
#include <Servo.h>
Servo myservo;
int zeiger=90;
int servopin=3;
Wifly wifly = Wifly(Serial1, 49, 74, 75, 76);
HttpClient http(wifly);
char buffer[1024];
void setup() {
wifly.initialize();
myservo.attach(servopin);
myservo.write(zeiger);
delay(15);
http.connect("liebesbarometer.zweizelgaenger.de");
}
void loop() {
//Zeiger
int zBytes = http.get(buffer, 1024, "liebesbarometer.zweizelgaenger.de", "/zeiger.php");
if (zBytes <= 0) {
//error
}
else {
int zeiger=atoi(buffer);
myservo.write(zeiger);
}
}