Thank you Mart and Rob
I try the other core with no result (for the moment)
I am using your library, Rob : both dht11 and dht this doesn't save the situation
I just order attiny 85 20 pu
within the next forthnight I will keep you informed
Dennis
Hello Rob
using the code up I get
text1: 00.00 ; 00.00
time to time
text1: 00.00;02.00
within the next weeks I will try the sketch test ( I wait for a new DHT)
I am not pretty sure that your dht .h is responsible of the errors.
I dont know if it is useful but:
Using the attiny84 with ds18B20 everything is ok if I dont use the power output on the pin 2.
If I use it ,Idont read DS18B20 (-85.00 )despite the fact the 3.3 V are presents on pin 2,
shortening the pin 1 and the pin 2 makes the result ok.
the same action doesn't save the situation with DHT22.
As promise I will do the test of the test sketch
I have time I am retired for more than 10 years ............
float DHT::readTemperature(bool S) {
float f;
if (read()) {
switch (_type) { // <<<<<<<<<< if not initialized it won't execute any code and return zero.
case DHT11:
f = data[2];
if(S)
f = convertCtoF(f);
return f;
case DHT22:
case DHT21:
f = data[2] & 0x7F;
f *= 256;
f += data[3];
f /= 10;
if (data[2] & 0x80)
f *= -1;
if(S)
f = convertCtoF(f);
return f;
}
}
return NAN;
}
Hi Rob
You are true , I was using adafruit's library . I got an horrible mess
in my libaries folder using the wrong way ( cut copy paste ).
I don't succeed with your recommendations both attiny84 & 85?
I am not at a sufficient level in C.
So I try not using one wire.
Finally I write a code " falling down working by accident " using adafruit's library .
this code work both attiny 84 and 85.
// Basic node using adafruit dht lib (july 2014 version)
// code dennis V. W. picked up from misc examples
#include <VirtualWire.h>
#include <DHT.h>
//#include <Narcoleptic.h>//don't work with attiny85
#define DHTPIN 2////attiny85 (2)7 attiny84 (8)11
#define DHTTYPE DHT22
DHT dht(DHTPIN, DHTTYPE,3);//<<<<<<<< modification for 8 Mhz
int t;
int h;
#define DTH22_POWER 0 ////attiny85 (0)5 attiny84 (0)2
const int transmit_pin = 1; //attiny85 (1)6 attiny84 (5)8
char dataString [15];
//----------------------------------------------------------------
void setup()
{
pinMode(DTH22_POWER, OUTPUT);
vw_set_tx_pin(transmit_pin);
vw_set_ptt_inverted(true);
vw_setup(2000);
}
//---------------------------------------------------------------
void loop()
{
digitalWrite(DTH22_POWER, HIGH);
delay(2000);
float h = dht.readHumidity();
float t = dht.readTemperature();
int t1 = (t-(int)t)*100;
sprintf(dataString,"T/H 1:;%1d.%1d;%1d;",int(t),t1,int(h));
vw_send((uint8_t *)dataString, 15);
vw_wait_tx();
digitalWrite(DTH22_POWER, LOW);
delay(60000);
//Narcoleptic.delay(60000);//don't work with attiny85
}