The Digispark > Digispark Projects

DigiSpark + Temperature Sensor

(1/1)

NoG:
Dear coders,
I was just trying to connect and test some modules (sensors) on the Digispark. I was also testing DHT11 temperature sensor. I have coded just really simple code for it. I have used DigisparkKeyboard feature, since Digispark does not support Serial Monitor. However it seems like, I have also done some mistakes in my code. I'm sure, that my circuit connection is OK. Can I ask, why I do not get any output?
Thank you for all the answers.

Code:

--- Code: ---#define period 5

#include <DHT.h>
#include <DigiKeyboard.h>
DHT dht(4, DHT11);

void setup() {
  dht.begin();
  DigiKeyboard.sendKeyStroke(0);
}

void loop() {
  float t = dht.readTemperature();
  float h = dht.readHumidity();

  DigiKeyboard.println(t);
  delay(period*1000);
}
--- End code ---

Navigation

[0] Message Index

Go to full version