[![my tryout build, the uno you see is just the "programmer" script runs on the Attiny85][1]][1]
[1]: https://i.sstatic.net/JkBGv.jpg
Ok i tried something like that for myself and thanks to this and ..many other posts and forums/videos i could make myself something that works but with a little other setting like in the start post (other libs ect)
in my case the main reason for the "1" output on the oled was this:
float hu = (DHT.humidity, 1); //original
float hu = (DHT.humidity); //what worked for me
Maybe you can figure out more Problems, my code is shure not perfekt! But maybe it helps someone for a vew steps
#include <dht.h>
#include <U8x8lib.h>
#define DHT11_PIN 1
dht DHT;
int temp = 0;
int humi = 0;
char strTemp[4];
char strHumi[4];
U8X8_SSD1306_128X64_NONAME_SW_I2C u8x8(/* clock=*/ 2, /* data=*/ 0, /* reset=*/ U8X8_PIN_NONE); // Digispark ATTiny85 Pin 0 Data, Pin 2 clock
void setup(void)
{
u8x8.begin();
u8x8.setPowerSave(0); //enegergiesparen 0 aus
}
void loop(void)
{
int chk = DHT.read11(DHT11_PIN);
temp = (DHT.temperature);
humi = (DHT.humidity);
u8x8.setFont(u8x8_font_chroma48medium8_r);
u8x8.drawString(0,0,"~~~~~~~~~~~~~~~~");
u8x8.drawString(0,1,"Temperatur");
u8x8.drawString(1,2,( itoa(int(temp), strTemp, 10)));
u8x8.drawString(4,2,"Grad Celsius");
u8x8.drawString(1,3,"--------------");
u8x8.drawString(0,4,"Luftfeuchtigkeit");
u8x8.drawString(1,5,( itoa(int(humi), strHumi, 10)));
u8x8.drawString(4,5,"Prozent");
u8x8.drawString(0,6,"~~~~~~~~~~~~~~~~");
delay(200);
}