• Witaj na Forum Arduino Polska! Zapraszamy do rejestracji!
  • Znajdziesz tutaj wiele informacji na temat hardware / software.
Witaj! Logowanie Rejestracja


Ocena wątku:
  • 0 głosów - średnia: 0
  • 1
  • 2
  • 3
  • 4
  • 5
LCD 16x2 z I2C, nic nie wyświetla
#1
Ogólnie mam taki problem, że moj klon Arduino UNO po podłączeniu I2C wraz z LCD 16x2, zapala się zaświecają się górne kratki ale nic się nie wyświetla, podpiętę mam to pod SCL i SDA na Arduino oraz tak jak ma być 5V oraz GND, I2C Scanner wykrywa że jest to w porcie 0x27, czyli taki jak mam napisany w kodzie. Ogólnie jeśli pisze np. lcd.blink(); to to działa ale jeśli pisze lcd.print("Co kolwiek"); to nie wyświetla tego. Sprawdzałem to I2CexpDiag który jest przykładem w bibliotece hd44780, ludzie na innych forach mówili aby to sprawdzić. I w drugim kodzie jest własnie efekt który wyświetla się w COM4


Kod:
#include <hd44780.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>


LiquidCrystal_I2C lcd(0x27, 16, 2);

void setup() {
  lcd.init();
  lcd.backlight();
}
void loop() {
  delay(1000);
  lcd.setCursor(0,0);
  lcd.print("Test");
  lcd.setCursor(0,1);
  lcd.print("LCD");
 
}
Kod:
@I
********************************************************************
Serial Initialized
--------------------------------------------------------------------
I2CexpDiag - i2c LCD i/o expander backpack diagnostic tool
--------------------------------------------------------------------
hd44780 lib version: 1.3.2
--------------------------------------------------------------------
Reported Arduino Revision: 1.8.16
CPU ARCH: AVR - F_CPU: 16000000
--------------------------------------------------------------------
SDA digital pin: 18 A4
SCL digital pin: 19 A5
--------------------------------------------------------------------
Checking for required external I2C pull-up on SDA - YES
Checking for required external I2C pull-up on SCL - YES
Checking for I2C pins shorted together - Not Shorted
--------------------------------------------------------------------
Scanning i2c bus for devices..
i2c device found at address 0x27
Total I2C devices found: 1
--------------------------------------------------------------------
Scanning i2c bus for all lcd displays (4 max)
LCD at address: 0x27 | config: P01245673H | R/W control: Yes
Total LCD devices found: 1
--------------------------------------------------------------------
LCD Display Memory Test
Display: 0
Walking 1s data test:    
    Compare error: addr: 0 read 45 != wrote 1
    Compare error: addr: 0 read 46 != wrote 2
    Compare error: addr: 0 read 44 != wrote 4
    Compare error: addr: 0 read 4C != wrote 8
    Compare error: addr: 0 read 54 != wrote 10
    Compare error: addr: 0 read 64 != wrote 20
    Compare error: addr: 0 read 44 != wrote 40
    Compare error: addr: 0 read C4 != wrote 80

    Compare error: addr: 40 read 45 != wrote 1
    Compare error: addr: 40 read 46 != wrote 2
    Compare error: addr: 40 read 44 != wrote 4
    Compare error: addr: 40 read 4C != wrote 8
    Compare error: addr: 40 read 54 != wrote 10
    Compare error: addr: 40 read 64 != wrote 20
    Compare error: addr: 40 read 44 != wrote 40
    Compare error: addr: 40 read C4 != wrote 80

    Compare error: addr: 10 read 45 != wrote 1
    Compare error: addr: 10 read 46 != wrote 2
    Compare error: addr: 10 read 44 != wrote 4
    Compare error: addr: 10 read 4C != wrote 8
    Compare error: addr: 10 read 54 != wrote 10
    Compare error: addr: 10 read 64 != wrote 20
    Compare error: addr: 10 read 44 != wrote 40
    Compare error: addr: 10 read C4 != wrote 80

    Compare error: addr: 50 read 45 != wrote 1
    Compare error: addr: 50 read 46 != wrote 2
    Compare error: addr: 50 read 44 != wrote 4
    Compare error: addr: 50 read 4C != wrote 8
    Compare error: addr: 50 read 54 != wrote 10
    Compare error: addr: 50 read 64 != wrote 20
    Compare error: addr: 50 read 44 != wrote 40
    Compare error: addr: 50 read C4 != wrote 80
FAILED
Address line test:    
    Compare error: addr: 0 read 64 != wrote 0
    Compare error: addr: 1 read 65 != wrote 1
    Compare error: addr: 2 read 66 != wrote 2
    Compare error: addr: 3 read 67 != wrote 3
    Compare error: addr: 4 read 64 != wrote 4
    Compare error: addr: 5 read 65 != wrote 5
    Compare error: addr: 6 read 66 != wrote 6
    Compare error: addr: 7 read 67 != wrote 7
    Compare error: addr: 8 read 55 != wrote 8
    Compare error: addr: 9 read FF != wrote 9
    Compare error: addr: B read FF != wrote B
    Compare error: addr: C read 55 != wrote C
    Compare error: addr: E read F5 != wrote E
    Compare error: addr: F read FF != wrote F
    Compare error: addr: 10 read 64 != wrote 10
    Compare error: addr: 11 read 65 != wrote 11
    Compare error: addr: 12 read 66 != wrote 12
    Compare error: addr: 13 read 67 != wrote 13
    Compare error: addr: 14 read 64 != wrote 14
    Compare error: addr: 15 read 65 != wrote 15
    Compare error: addr: 16 read 66 != wrote 16
    Compare error: addr: 17 read 67 != wrote 17
    Compare error: addr: 18 read 55 != wrote 18
    Compare error: addr: 19 read FF != wrote 19
    Compare error: addr: 1A read F5 != wrote 1A
    Compare error: addr: 1B read FF != wrote 1B
    Compare error: addr: 1C read 55 != wrote 1C
    Compare error: addr: 1D read FF != wrote 1D
    Compare error: addr: 1E read F5 != wrote 1E
    Compare error: addr: 1F read FF != wrote 1F
    Compare error: addr: 20 read 64 != wrote 20
    Compare error: addr: 21 read 65 != wrote 21
    Compare error: addr: 22 read 66 != wrote 22
    Compare error: addr: 23 read 67 != wrote 23
    Compare error: addr: 24 read 64 != wrote 24
    Compare error: addr: 25 read 65 != wrote 25
    Compare error: addr: 26 read 66 != wrote 26
    Compare error: addr: 27 read 67 != wrote 27

    Compare error: addr: 40 read 64 != wrote 40
    Compare error: addr: 41 read 65 != wrote 41
    Compare error: addr: 42 read 66 != wrote 42
    Compare error: addr: 43 read 67 != wrote 43
    Compare error: addr: 44 read 64 != wrote 44
    Compare error: addr: 45 read 65 != wrote 45
    Compare error: addr: 46 read 66 != wrote 46
    Compare error: addr: 47 read 67 != wrote 47
    Compare error: addr: 48 read 55 != wrote 48
    Compare error: addr: 49 read FF != wrote 49
    Compare error: addr: 4A read F5 != wrote 4A
    Compare error: addr: 4B read FF != wrote 4B
    Compare error: addr: 4C read 55 != wrote 4C
    Compare error: addr: 4D read FF != wrote 4D
    Compare error: addr: 4E read F5 != wrote 4E
    Compare error: addr: 4F read FF != wrote 4F
    Compare error: addr: 50 read 64 != wrote 50
    Compare error: addr: 51 read 65 != wrote 51
    Compare error: addr: 52 read 66 != wrote 52
    Compare error: addr: 53 read 67 != wrote 53
    Compare error: addr: 54 read 64 != wrote 54
    Compare error: addr: 55 read 65 != wrote 55
    Compare error: addr: 56 read 66 != wrote 56
    Compare error: addr: 57 read 67 != wrote 57
    Compare error: addr: 58 read 55 != wrote 58
    Compare error: addr: 59 read FF != wrote 59
    Compare error: addr: 5A read F5 != wrote 5A
    Compare error: addr: 5B read FF != wrote 5B
    Compare error: addr: 5C read 55 != wrote 5C
    Compare error: addr: 5D read FF != wrote 5D
    Compare error: addr: 5E read F5 != wrote 5E
    Compare error: addr: 5F read FF != wrote 5F
    Compare error: addr: 60 read 64 != wrote 60
    Compare error: addr: 61 read 65 != wrote 61
    Compare error: addr: 62 read 66 != wrote 62
    Compare error: addr: 63 read 67 != wrote 63
FAILED
Memory test failures are usually due to poor solder connections
Most common cause is poor solder joints on pins soldered to the LCD

--------------------------------------------------------------------
No working LCD devices
 
Odpowiedź
#2
Do tego nie wiem czy to ma tak być ale na Arduino obok L mruga co chwile dioda, coś typu:
mrugnięcie - około pół sekundy - mrugnięcie - około 2 sekundy - i od nowa
i to tak w kółko
 
Odpowiedź
#3
Ustawiałeś kontrast ekranu?
 
Odpowiedź
#4
(11-12-2021, 20:09)kaczakat napisał(a): Ustawiałeś kontrast ekranu?
Tak regulowałem go

Wysłane z mojego M2101K7BNY przy użyciu Tapatalka
 
Odpowiedź
#5
Tutaj zdj całego tego
*Zdj zrobione gdy miałem podpięte to pod baterię bo nie chciało mi się kompa włączać*[Obrazek: 94d45a2c2c082c0784922ac552a97e13.jpg][Obrazek: fb5de8fc7265b159ef1f13f90da34f0c.jpg][Obrazek: 1dc1d55f4ace109144e449bea8afc74a.jpg][Obrazek: 57afe4104baf4ab7becf2d332f3320f4.jpg][Obrazek: 647c91e4baad1f843ee75b6325ae7f4e.jpg]

Wysłane z mojego M2101K7BNY przy użyciu Tapatalka
 
Odpowiedź
#6
Spróbuj zgodnie z tym wątkiem:
https://forum.arduino.cc/t/solved-i2c-lc...6x2/125986

Jest tam mowa dokładnie o takim zestawie jak Twój i na pierwszy rzut oka są różnice w kodzie.

Wysłane z mojego POCOPHONE F1 przy użyciu Tapatalka
 
Odpowiedź
  


Skocz do:


Przeglądający: 1 gości