3

I have tried many combinations and I can get the Attiny85 to display on the TM1637 just fine, but I cannot get ant readings from the DTH11, tried different pins, libraries. I upload code via UNO as isp and that works fine. Tried same code on UNO and it works.

This is my first question on here, I usually figure things, but also first ATtiny85 adventure.

enter image description here

#include <TM1637Display.h>
#include "DHT.h"
#define CLK 4
#define DIO 3
#define DHTPIN 2  //
#define DHTTYPE DHT11
int MTD (2000);
TM1637Display display = TM1637Display(CLK, DIO);
DHT dht(DHTPIN, DHTTYPE);

const uint8_t celsius[] = { SEG_A | SEG_B | SEG_F | SEG_G, SEG_A | SEG_D | SEG_E | SEG_F }; // oC const uint8_t Fahrenheit[] = { SEG_A | SEG_B | SEG_F | SEG_G, SEG_A | SEG_E | SEG_F | SEG_G }; // oF const uint8_t Humidityh[] = { SEG_B | SEG_C | SEG_E | SEG_F | SEG_G, SEG_C | SEG_D | SEG_E | SEG_F | SEG_B }; // HU

void setup() { dht.begin(); display.setBrightness(7); }

void loop() { delay(1000); float Humidity = dht.readHumidity(); float TemperatureC = dht.readTemperature(); float TemperatureF = dht.readTemperature(true);

display.showNumberDecEx(TemperatureF, 0b10000000, false, 2, 0); display.setSegments(Fahrenheit, 2, 2); delay(MTD); display.showNumberDecEx(Humidity, 0b10000000, false, 2, 0); display.setSegments(Humidityh, 2, 2); delay(MTD); display.showNumberDecEx(TemperatureC, 0b10000000, false, 2, 0); display.setSegments(celsius, 2, 2); delay(MTD-1000); }

ocrdu
  • 1,795
  • 3
  • 12
  • 24

1 Answers1

3

Found <TinyDHT.h> and all works ok, just what I wanted.