Troubles with DHT11 and Attiny85


i have gotten arduino programming , have been using attiny85 microprocessor. issue have attempted connect 433mhz rf transmitters attiny processors, had initial success , able transfer float values , integers using data structures. library using task radiohead ask library. wanted attempt connect dht11 sensor attiny85 , transfer data arduino uno. problem attiny cannot seem read data dht11, have tried many libraries including dht11lib, dht11stable , adafruit dht libraries. have taken multimeter circuit , know dht , attiny communicating due voltage fluctuations. when try run code values of 0 on receive side, know transmit , receive functions work because can hook other sensors aren't dht. have tried looking everywhere similar issue solutions find dont seem work scenario. had gotten part of code previous forum thread on how send multiple float values. using 5.2k resistor dht11. had gotten code work arduino arduino transmission stuck on getting attiny want work dht11.

example of code:
code: [select]
#include <dht.h>
#include <rh_ask.h>

#define dht11_pin 4
dht dht;


//rh_ask driver;
rh_ask driver(2000, 11, 3);


struct datastruct {
  float temp;
} mydata;

byte tx_buf[sizeof(mydata.temp)] = {0};



void setup()
{
  driver.init();
  //serial.begin(9600);
}

void loop()
{
  int chk = dht.read11(dht11_pin);

  mydata.temp = dht.temperature;

  //serial.println(mydata.temp);

  memcpy(tx_buf, &mydata.temp, sizeof(mydata.temp) );
  byte zize = sizeof(mydata.temp);

  driver.send((uint8_t *)tx_buf, zize);

  //  driver.send((uint8_t *)msg, strlen(msg));
  driver.waitpacketsent();

 
 
  delay(1000);
}


do dht , radiohead libraries use same hardware timer?


Arduino Forum > Using Arduino > Programming Questions > Troubles with DHT11 and Attiny85


arduino

Comments

Popular posts from this blog

Flip address is out of range arduino uno r3

Arduino Uno not uploading

Indesign and MathType fonts