Browse Source

Code ergänzt

master
Johannes Krug 5 years ago
parent
commit
38fdf6596c
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      arduino/wlan_an_rpi/wlan_an_rpi.ino

+ 2
- 2
arduino/wlan_an_rpi/wlan_an_rpi.ino View File

Serial.println(); Serial.println();
Serial.print("Connecting to "); Serial.print("Connecting to ");
Serial.println(SSID); Serial.println(SSID);
WiFi.mode(WIFI_STA);
WiFi.begin(SSID, PSK); WiFi.begin(SSID, PSK);
while (WiFi.status() != WL_CONNECTED) { while (WiFi.status() != WL_CONNECTED) {
snprintf (msg, 50, "Alive since %ld milliseconds", millis()); snprintf (msg, 50, "Alive since %ld milliseconds", millis());
Serial.print("Publish message: "); Serial.print("Publish message: ");
Serial.println(msg); Serial.println(msg);
client.publish("/home/data", "Hello World");
client.publish("/home/data", "Hello asdf World");
delay(5000); delay(5000);
} }



Loading…
Cancel
Save