i am fighting with this problem for all night long, and nothing working for me... I have tried with alot of methods founded on the internet, but i'm still locked here.
All I want is to write an number in the middle of an char string to display it on an oled screen using an nodemcu v3 based on ESP8266.
This is what I want to have on my screen: S7:3.55V
3.55 could be an number between 3.02 and 4.87.
Actual error is: invalid conversion from 'long int' to 'char*' [-fpermissive]
#include <Wire.h>
#include "OLED.h"
#include <sstream>
#include <iostream>
#include <string>
#include <cstring>
#include <iomanip>
#include <locale>
OLED display(2, 14); //OLED Declarare SDA, SCL
long randNumber;
void setup() {
Serial.begin(9600);
Serial.println("OLED test!");
// Initialize display
display.begin();
//display.off();
//display.on();
display.clear();
delay(3*1000);
}
void loop() {
randNumber = random(3.02, 4.87);
display.print("S7:", 5);
display.print(randNumber, 5);
display.print("V", 5);
//display.print("Banc: ", 7);
//display.print(randNumber1, 7);
//display.print("V", 7);
delay(3*200);
}