Hi, my Code isn´t working, because I don´t understand how to convert data types. I have tried countless internet tutorials, but the more I search, the less I understand about converting them.
I get this error while compiling: cannot convert 'String' to 'const void*'
I want to make a clock, that is displayed on a VGA Monitor. The ESP get´s the time via Wifi.
Sorry for my bad English btw.
Thanks for any help!
Henry
My Code:
#include <ESPVGAX.h>
#include <fonts/monodos12.h>
#include <NTPClient.h>
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
WiFiUDP ntpUDP;
NTPClient timeClient(ntpUDP);
ESPVGAX vga;
const char *ssid = "ssid";
const char *password = "password";
const ESPVGAX_ALIGN32 char str0[] PROGMEM="Starting up...";
String stringOne;
void setup() {
Serial.begin(115200);
WiFi.begin(ssid, password);
while ( WiFi.status() != WL_CONNECTED ) {
delay ( 500 );
Serial.print ( "." );
}
timeClient.begin();
vga.begin();
vga.setBitmapFont((uint8_t*)img_monodos12_data, 12);
vga.print_P(str0, 150, 150, true);
delay(5000);
}
void loop() {
timeClient.update();
// Serial.println(timeClient.getFormattedTime());
stringOne = timeClient.getFormattedTime();
Serial.println(stringOne);
char* henry;
henry = (char*) malloc(20);
memcpy(henry, stringOne, 2);
vga.setBitmapFont((uint8_t*)img_monodos12_data, 12);
vga.print_P(stringOne, 150, 150, true);
delay(1000);
}