(you are viewing a thread; or go back to
list of threads)
how to display variable in LCD_I2C? (by fernando)
Good afternoon. Could someone tell me what my programming error is?
I want to show the value of the C1 counter on an LCD16x2, and I don't get it
I pass the program file
Thank you
Como mostrar variable en LCD_I2C?
Buenas tardes. Alguien me podría decir cual es mi error en la programación?
Quiero mostrar el valor del contador C1 en un LCD16x2, y no lo logro
Les paso el archivo del programa
Gracias
(no subject) (by Paulino)
(no subject) (by José)
Don't follow this link !
Ldmicro32 is not up to date ; use ldmicro 5.3.1.0
Here's attached something like you want to do ; it works on my
Atmega328 board.
The problem is that you can't display 0 as a value to get a 0 but you must display '0' as a character (see ascii table) etc
Verify that you have modified you display I2C address in I2Clib.c ; probably 0x27 or 0x20.
If nothing appears => bad address
José
(no subject) (by José)
Don't forget to set LCD contrast (with trimmer) if nothing appears on any I2C address !
how to display variable in LCD_I2C? (by fernando)
Muchas gracias por tu ayuda José, funciona correctamente.
Si, estoy usando la versión 5.3.1.0 con un Atmega328
Pregunta
- porqué hay que realizar la operación SUMAR antes de enviar la variable a la función I2C_WR?
- como tengo que hacer si quiero mostrar una variable de 4 dígitos?
Gracias
Thank you very much for your help José, it works correctly.
Yes, I am using version 5.3.1.0 with an Atmega328
Question
- Why do you have to perform the SUM operation before sending the variable to the I2C_WR function?
- How do I have to do if I want to display a 4-digit variable?
Thank you
how to display variable in LCD_I2C? (by fernando)
Ahora estoy intentando mostrar el valor de una entrada analógica en un LCD16x2, y no lo logro
Les paso el diagrama de escalera para que lo vean y puedan comentarme cual es mi error
Muchas gracias
Now I am trying to show the value of an analog input on an LCD16x2, and I don't get it
I pass the ladder diagram for you to see and can tell me what my mistake is
Thank you
(no subject) (by José)
Hi Fernando,
1)
You have to to SUM '0'= 0x30 = 48 to your values because the display doesn't know what a value is ; it only knows ascii characters table in which '0' = 48, ... , '9'= 57
2)
To display a value, there's normally a function in the libraries but it can't be used in Ldmicro because it requires parameters that can't be transmitted with a single I2C_WR instruction.
So, in Ldmicro, you have to split your number into single digits with some DIV and MOD instructions.
Ie:
if x = 45, display (x DIV 10) and (x MOD 10) => 4 5
if x = 745, display (x DIV 100) and ((x DIV 10) MOD 10) and (x MOD 10) => 7 4 5
And so on...
José
how to display variable in LCD_I2C? (by fernando)
Buenos días
Muchas gracias por su ayuda José
Realice un por de ejemplos en base a sus comentarios, los probé en mi Arduino UNO con una pantalla LCD16x2 y funcinan correctamente
Muchas gracias
Good Morning
Thank you very much for your help José
Make a sample of examples based on your comments, I tested them on my Arduino UNO with an LCD16x2 screen and they work correctly
Thank you
how to display variable in LCD_I2C? (by fernando)
Éste es el otro ejemplo
Saludos
This is the other example.
Regards
Post a reply to this comment:
|