Hi
I have learned that buy HW before reading is not the best way to get stuff to work. On top I'm not so experienced with Arduino so now I ask for some basic help, or I think its basic....
Have tried for days to understand how to connect a DHT20 to my TTGO LoRa32 board.
HW:
DHT20 (SEN-18364)
Pin layout:
MY PROBLEM
The sketches I have tried it seems to be a I2C bus or some pin assignments I dont grasp
In example under void setup() the LoRa pins are 18,14,26, an example, My DHT20 only have 2 pins SDA and SCL and i have connected them to 21 and 22 as in pin layout picture.
Question 1 is then, am I totally out of control, or is there a simple solution?
I hope for an answer that gives me folloving input/help:
SDA you connect to pin X
SCL you connect to pin Y
and in void loop you write: LoRa.setPins(?, ?, ?)
Thanks up front!
M
#include <SPI.h>
#include <LoRa.h> //https://github.com/sandeepmistry/arduino-LoRa
void setup() {
Serial.begin(115200);
Serial.println("LoRa Receiver");
LoRa.setPins(18, 14, 26); <-----------------------------------HERE IS FIRST QUESTION
if (!LoRa.begin(433E6)) {
Serial.println("Starting LoRa failed!");
while (1);
}
}
void loop() {
// try to parse packet
int packetSize = LoRa.parsePacket();
if (packetSize) {
// received a packet
// Serial.print("Received packet ");
// read packet
while (LoRa.available()) {
Serial.print((char)LoRa.read());
}
// print RSSI of packet
Serial.print(" RSSI was: ");
Serial.println(LoRa.packetRssi());
}
}