Using timezonedb API to call time.
hello,
i develop clock gets time timezonedb using api.
the plan display time in serial monitor.
i using adafruit eps32, arduino ide.
so far have managed connect wifi, , check signal strength. working correctly @ moment.
the problem having have never used api's , learn more , use in projects.
i appreciate advice/help how implement timezonedb api time.
https://timezonedb.com/api
thank you!
i develop clock gets time timezonedb using api.
the plan display time in serial monitor.
i using adafruit eps32, arduino ide.
so far have managed connect wifi, , check signal strength. working correctly @ moment.
the problem having have never used api's , learn more , use in projects.
i appreciate advice/help how implement timezonedb api time.
https://timezonedb.com/api
thank you!

code: [select]
#include <wifi.h>
#include <spi.h>
#include <time.h>
const char* ssid = "network";
const char* password = "password";
int status = wl_idle_status;
void setup() {
serial.begin(115200);
pinmode(led_builtin, output);
while (wifi.status() != wl_connected) {
serial.print("connecting wifi network: ");
serial.println(ssid);
status = wifi.begin(ssid, password);
delay(500);
}
serial.print("connected wifi network: ");
serial.println(ssid);
serial.print("your ip: ");
serial.println(wifi.localip());
}
void loop() { // loop function runs on , on again forever
digitalwrite(led_builtin, high); // turn led on (high voltage level)
delay(100); // wait 0.1 second
digitalwrite(led_builtin, low); // turn led off making voltage low
delay(100); // wait 0.1 second
digitalwrite(led_builtin, high); // turn led on (high voltage level)
delay(100); // wait 0.1 second
digitalwrite(led_builtin, low); // turn led off making voltage low
delay(1000); // wait 0.1 second
// checks network status
//
if (wifi.status() == wl_connected) { // checks network status
serial.print("wifi status: ");
serial.print("connected ");
serial.println(ssid);
//wl_no_shield = 255
//wl_idle_status = 0
//wl_no_ssid_avail = 1
//wl_scan_completed = 2
//wl_connected = 3
//wl_connect_failed = 4
//wl_connection_lost = 5
//wl_disconnected = 6
//wifi singal strength
long rssi = wifi.rssi();
unsigned long before = micros();
unsigned long after = micros();
serial.print("signal strength: ");
serial.print(rssi);
serial.println("dbm");
serial.print("took: ");
serial.print(after - before);
serial.println(" micro/seconds");
delay(1000);
}
} // end
Arduino Forum > Using Arduino > Networking, Protocols, and Devices (Moderator: fabioc84) > Using timezonedb API to call time.
arduino
Comments
Post a Comment