Aktywne Wpisy
restofme +193
Napisałem ten komentarz pod znaleziskiem 44-latek spędził niemal dobę na SOR-ze. Był po udarze i trafił na laryngologię.
Ktoś zasugerował że dobrze go tu wrzucić.
To ja coś z życia. Historia taka jak tu. Udar SOR itp. Długo będzie ale mam nadzieję że coś wniosę.
Jak się ogarnąłem to przez moment pisałem coś na Mirko
Chce Wam opowiedzieć swoją historię trochę terapeutycznie a trochę Wam ku przestrodze.
Nie chce pisać o szpitalach,
Ktoś zasugerował że dobrze go tu wrzucić.
To ja coś z życia. Historia taka jak tu. Udar SOR itp. Długo będzie ale mam nadzieję że coś wniosę.
Jak się ogarnąłem to przez moment pisałem coś na Mirko
Chce Wam opowiedzieć swoją historię trochę terapeutycznie a trochę Wam ku przestrodze.
Nie chce pisać o szpitalach,
Mam poważny problem i nie mogę przez to spać
Skoro większość kobiet nie ma tego mitycznego punktu G i samo wejście bolca nic nie znaczy, to po co tyle kobiet uprawia przygodny seks?
Przecież najlepiej chyba mieć coś z tego aktu a randomowy koleś na imprezie będzie miał wywalone w księżniczkę i najlepiej mieć stałego partnera który będzie o to dbał i znał nasze ciało. O co więc chodzi z tym, że
Skoro większość kobiet nie ma tego mitycznego punktu G i samo wejście bolca nic nie znaczy, to po co tyle kobiet uprawia przygodny seks?
Przecież najlepiej chyba mieć coś z tego aktu a randomowy koleś na imprezie będzie miał wywalone w księżniczkę i najlepiej mieć stałego partnera który będzie o to dbał i znał nasze ciało. O co więc chodzi z tym, że
tu mój kodzik, jest dużo śmiecia, ale składam projekt z kilku gotowych skryptów bo jestem noobem, wartości to sunset i sunshine, będę wdzięczby za sugestie.
#include
#include
#include
#include
#include
#include
#include
#include
#include
const char* ssid = "pamparam";
const char* password = "cykcykcyk";
String CityID = "3143244"; // Oslo, Nowray
String APIKEY = "dabudibudabudaj";
char servername[] = "api.openweathermap.org";
String result;
int counter = 60;
String Sunrise;
String Sunset;
int redPin = 13;
int greenPin = 12;
int bluePin = 14;
int valueR;
int valueG;
int valueB;
int SENSOR = 15;
float temp, humedad;
DHT dht (SENSOR, DHT11);
WiFiClient client;
void setup() {
Serial.begin(115200);
Serial.println("Connecting");
WiFi.begin(ssid, password);
while (WiFi.status() != WLCONNECTED) {
delay(500);
}
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
}
void setColor(int red, int green, int blue)
{
digitalWrite(redPin, red);
digitalWrite(greenPin, green);
digitalWrite(bluePin, blue);
}
void loop()
{
humedad = dht.readHumidity();
temp = dht.readTemperature();
Serial.print("Temperatura: ");
Serial.print(temp);
Serial.print("℃ Wilgotność: ");
Serial.print(humedad);
Serial.println("%");
Serial.print("Sunrise: ");
Serial.print(Sunrise);
Serial.print("Sunset: ");
Serial.print(Sunset);
if(counter == 60) //Get new data every 10 minutes
{
counter = 0;
delay(1000);
getWeatherData();
}else
{
counter++;
}
checkTemp();
delay(500);
}
void getWeatherData() //client function to send/receive GET request data.
{
if (client.connect(servername, 80)) { //starts client connection, checks for connection
client.println("GET /data/2.5/weather?id="+CityID+"&units=metric&APPID="+APIKEY);
client.println("Host: api.openweathermap.org");
client.println("User-Agent: ArduinoWiFi/1.1");
client.println("Connection: close");
client.println();
}
else {
Serial.println("connection failed"); //error message if no client connect
Serial.println();
}
while(client.connected() && !client.available()) delay(1); //waits for data
while (client.connected() || client.available()) { //connected or data available
char c = client.read(); //gets byte from ethernet buffer
result = result+c;
}
client.stop(); //stop client
result.replace('[', ' ');
result.replace(']', ' ');
Serial.println(result);
char jsonArray [result.length()+1];
result.toCharArray(jsonArray,sizeof(jsonArray));
jsonArray[result.length() + 1] = '\0';
StaticJsonBuffer<1024> jsonbuf;
JsonObject &root = json_buf.parseObject(jsonArray);
if (!root.success())
{
Serial.println("parseObject() failed");
}
String sunrise = root["sys"]["sunrise"];
String sunset = root["sys"]["sunset"];
Sunrise = sunrise;
Sunset = sunset;
1519884007000 w ms
1519884007 w sekundach
https://arduino.stackexchange.com/questions/38765/convert-to-and-from-unix-timestamp
@Borsuk69: chyba każdy, kto jest związanych chociaż trochę z #programowanie sie z tym spotkał
@Borsuk69: UL na końcu to definicja typu (unsigned long) z #jezykc oraz #cpp