·

Cursos Gerais ·

Laboratório de Sistemas Digitais

Send your question to AI and receive an answer instantly

Ask Question

Preview text

Projeto de Hardware Sistemas Digitais Leonel Tedesco Marco Hennes leoneltedescouniscbr hennesuniscbr Microcontroladores Display de Cristal Líquido LCD Conexões comuns 8 bits 4 bits Existe também serial porém nesse caso o display deve ser serial LiquidCrystal lcd12 11 5 4 3 2 void setup empty lcdbegin16 2 Table 121 Pin Descriptions for LCD Pin Symbol IO Description 1 VSS Ground 2 VCC 5V power supply 3 VEE Power supply to control contrast 4 RS I RS0 to select command register RS1 to select data register 5 RW I RW0 for write RW1 for read 6 E IO Enable 7 DB0 IO The 8bit data bus 8 DB1 IO The 8bit data bus 9 DB2 IO The 8bit data bus 10 DB3 IO The 8bit data bus 11 DB4 IO The 8bit data bus 12 DB5 IO The 8bit data bus 13 DB6 IO The 8bit data bus 14 DB7 IO The 8bit data bus Print a message to the LCD Table 122 LCD Command Codes Code Command to LCD Instruction Hex Register 1 Clear display screen 2 Return home 4 Decrement cursor shift cursor to left 6 Increment cursor shift cursor to right 5 Shift display right 7 Shift display left 8 Display off cursor off A Display off cursor on C Display on cursor off E Display on cursor blinking F Display on cursor blinking 10 Shift cursor position to left 14 Shift cursor position to right 18 Shift the entire display to the left 1C Shift the entire display to the right 80 Force cursor to beginning of 1st line C0 Force cursor to beginning of 2nd line 38 2 lines and 5x7 matrix Convertendo para ASCII O LCD apresenta caracteres em ASCII Exemplo número 0x08 0x38 8 lcdprinthello world Funcionamento IO 8 pinos de dados D7D0 RS Dados ou comando RW Leitura ou escrita E Enable Latch RS Register Select RS 0 Comando RS 1 Dados RW 0 Write RW 1 Read E Enable D0 D7 Pinos usados para enviar dados e comandos Caracteres enviandos em ASCII 9 E RW RS DB7DB0 LCD controller communications bus Microcontroller 8 LCD Module void loop Endereços do LCD 16 x 2 LCD 80 81 82 83 84 85 86 through 8F C0 C1 C2 C3 C4 C5 C6 through CF 20 x 1 LCD 80 81 82 83 20 x 2 LCD 80 81 82 83 through 93 C0 C1 C2 C3 through D3 20 x 4 LCD 80 81 82 83 through 93 C0 C1 C2 C3 through D3 94 95 96 97 through A7 D4 D5 D6 D7 through E7 40 x 2 LCD 80 81 82 83 through A7 C0 C1 C2 C3 through E7 Note All data is in hex set the cursor to column 0 line 1 HD44780U LCDII Dot Matrix Liquid Crystal Display ControllerDriver HITACHI note line 1 is the second row since Configura Display lcdsetCursor0 1 Arduino no Tinkercad print the number of seconds since reset Envia Comandos para o LCD void lcdcmdbyte b digitalWriteRS LOWRS0 Comando digitalWriteEN HIGH digitalWriteD0 b61 digitalWriteD1 b62 digitalWriteD2 b64 digitalWriteD3 b8 digitalWriteD4 b16 digitalWriteD5 b32 digitalWriteD6 b64 digitalWriteD7 b128 delay2 digitalWriteEN LOW delay2 Escreve no LCD void lcdescrevebyte b digitalWriteRS HIGHRS1 Dados escrita digitalWriteEN HIGH digitalWriteD0 b61 digitalWriteD1 b62 digitalWriteD2 b64 digitalWriteD3 b8 digitalWriteD4 b16 digitalWriteD5 b32 digitalWriteD6 b64 digitalWriteD7 b128 delay2 digitalWriteEN LOW delay2 Inicializa LCD void lcdinit lcdcmd0x38 delay5 lcdcmd0x38 delay1 lcdcmd0x38 lcdcmd0x06 lcdcmd0x0E lcdcmd0x01 delay5 Engenharia Laboratório Contador de produtos industriais Colocar 1 sensor de contagem 1 botão zerar a contagem lcdprintmillis 1000