// The Servo library that comes with the ATTinyCore
// uses Timer1, which is not simulated by Wokwi.
//
// ATtinyCore: https://github.com/SpenceKonde/ATTinyCore
//
// TinyDebug: An extra from the Wokwi simulator:
// https://docs.wokwi.com/parts/wokwi-attiny85
//
// TinyServo: A servo using Timer0 ?
// https://github.com/roberttidey/TinyServo
// This was no solution, because the interrupt
// for vector5 is already in use by the ATTinyCore.
//
//
#include <TinyDebug.h> // an extra from the Wokwi simulator
#include <dht.h> // DHTlib by Rob Tillaart
// The Servo library is included in the ATTinyCore,
// but not compatible with the Wokwi simulator
// #include <Servo.h> // or Servo_ATTinyCore.h
// Servo servo;
dht DHT;
#define DHT22_PIN 2
void setup()
{
Debug.begin();
Debug.println(F("Hello, TinyDebug !"));
// servo.attach(1);
}
void loop()
{
int chk = DHT.read22(DHT22_PIN);
if( chk == DHTLIB_OK)
{
Debug.println(DHT.humidity);
Debug.println(DHT.temperature);
}
else
{
Debug.println(chk);
}
// servo.write(0);
delay(1000);
// servo.write(180);
delay(1000);
}