всё спаяно хорошо а выдаёт квадратики яркость регулировал,разные коды пробовал всё одно и тоже помогите
#include <Wire.h> #include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd(0x3F,16,2); // set the LCD address to 0x20 for a 16 chars and 2 line display void setup() { lcd.init(); // initialize the lcd // Print a message to the LCD. lcd.backlight(); lcd.print("Hello, world!"); } void loop() { } стандартный Hello, world! адрес I2C просканировал и заменил
Попробуйте так Код (C++): #include <Wire.h> #include <LiquidCrystal_I2C.h> #define BACKLIGHT_PIN 13 LiquidCrystal_I2C lcd(0x20, 4, 5, 6, 0, 1, 2, 3, 7, NEGATIVE); void setup() { // Switch on the backlight pinMode ( BACKLIGHT_PIN, OUTPUT ); digitalWrite ( BACKLIGHT_PIN, HIGH ); lcd.begin(16,2); // initialize the lcd lcd.home (); // go home lcd.print("Hello ARDUINO "); } void loop() { } только адрес правильный нужно
Arduino: 1.8.1 (Windows 10), Плата:"Arduino/Genuino Uno" HelloWorld:6: error: 'NEGATIVE' was not declared in this scope LiquidCrystal_I2C lcd(0x20, 4, 5, 6, 0, 1, 2, 3, 7, NEGATIVE); ^ exit status 1 'NEGATIVE' was not declared in this scope Этот отчёт будет иметь больше информации с включенной опцией Файл -> Настройки -> "Показать подробный вывод во время компиляции"
Возможно разны библиотеки, я в свое время так же мучаслся с китайскими I2C. Нашел рабочую и ей пользуюсь, может вам поможет, кстати, у меня работает только с параметром NEGATIVE, так, на всякий случай. O, вот оно! https://arduino-info.wikispaces.com/LCD-Blue-I2C тут для разный китайских адаптеров решения
Вообще то китайских контроллеров не бывает все они фирмы Atmel. Это что за адрес? LiquidCrystal_I2C lcd(0x3F,16,2); // set the LCD address to 0x20 for a 16 chars and 2 line display Откуда Вы его взяли? А это что за шняга? LiquidCrystal_I2C lcd(0x20, 4, 5, 6, 0, 1, 2, 3, 7, NEGATIVE); Надо так вообще то:LiquidCrystal_I2C lcd(0x27,16,2); /* Задаем адрес и размерность дисплея. Пример здеся
Возможно.Но из 20 модулей которые прошли через мои руки у всех был адрес 0х27 да и в примерах он везде.
Приветствую форумчан , сам вчера попал в такуюж ситуацию , 2 дисплея , один завёлся на 3F другой на 3C , очень помог код i2c сканера , вывод идёт на терминал в IDE . Спасибо автору кода , кто бы он ни был . Код (C++): #include <Wire.h> void setup() { Wire.begin(); Serial.begin(9600); while (!Serial); // Leonardo: wait for serial monitor Serial.println("\nI2C Scanner"); } void loop() { byte error, address; int nDevices; Serial.println("Scanning..."); nDevices = 0; for(address = 1; address < 127; address++ ) { // The i2c_scanner uses the return value of // the Write.endTransmisstion to see if // a device did acknowledge to the address. Wire.beginTransmission(address); error = Wire.endTransmission(); if (error == 0) { Serial.print("I2C device found at address 0x"); if (address<16) Serial.print("0"); Serial.print(address,HEX); Serial.println(" !"); nDevices++; } else if (error==4) { Serial.print("Unknow error at address 0x"); if (address<16) Serial.print("0"); Serial.println(address,HEX); } } if (nDevices == 0) Serial.println("No I2C devices found\n"); else Serial.println("done\n"); delay(5000); // wait 5 seconds for next scan }