17. Arduino 1602 LCD Module - LiquidCrystal

Аватар автора
путешествует по миру
Arduino 1602 LCD Module - LiquidCrystal . Simple to connect and to program. You can get a module with just 4 wire , also you need just 2 wire from your arduino board 2 to display and other two plus and ground . Code : // IMPORTANT replace all brackets to left or right brackets to get code to work "left bracket" LiquidCrystal.h "right bracket" // initialize the library with the numbers of the interface pins LiquidCrystal lcd(12, 11, 5, 4, 3, 2); //KY015 DHT11 Temperature and humidity sensor int DHpin = 8; byte dat [5]; byte read_data () { byte data; for (int i = 0; i "left bracket" 8; i ++) { if (digitalRead (DHpin) == LOW) { while (digitalRead (DHpin) == LOW); // wait for 50us delayMicroseconds (30); // determine the duration of the high level to determine the data is &&'1' if (digitalRead (DHpin) == HIGH) data |= (1 "double left bracket" (7-i)); // high front and low in the post while (digitalRead (DHpin) == HIGH); // data &&wait for the next one receiver } } return data; } void start_test () { digitalWrite (DHpin, LOW); // bus down, send start signal delay (30); // delay greater than 18ms, so DHT11 start signal can be detected digitalWrite (DHpin, HIGH); delayMicroseconds (40); // Wait for DHT11 response pinMode (DHpin, INPUT); while (digitalRead (DHpin) == HIGH); delayMicroseconds (80); // DHT11 response, pulled the bus 80us if (digitalRead (DHpin) == LOW); delayMicroseconds (80)...

0/0


0/0

0/0

0/0