Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
LCDi2c.pde It doesn't work as expected.
03-06-2019, 07:02 PM, (This post was last modified: 07-06-2019, 05:11 AM by orlandomax. Edit Reason: Add information )
#1
LCDi2c.pde It doesn't work as expected.
It doesn't work as expected.

In the example LCDi2c.pde the variable "I" is only displayed or counted up to 999, then disappears. Using "lcdi2c.printNumber(intf, i++, DEC);" Only counts up to 99 then shows 3333. I'm using the IDEv12 with pingüino4550.  I ran tests on the IDE11 and this doesn't happen. Does anyone have a solution? Thank you.

In the aggregate image you can see what happens or doesn't happen.


No funciona como se espera.

En el ejemplo LCDi2c.pde La variable “I” solo se muestra o cuenta hasta 999, luego desaparece. Usando “lcdi2c.printNumber(intf, i++, DEC);” solo cuenta hasta 99 luego muestra 3333. Estoy usando el IDEv12 con pingüino4550. Hice pruebas con el IDE11 y esto no pasa. ¿alguien tiene una solución?. Gracias.

En la imagen agregada pueden ver lo que pasa o que no pasa.


Attached Files Thumbnail(s)
   
Reply
06-06-2019, 07:51 PM,
#2
RE: LCDi2c.pde It doesn't work as expected.
I think it's a problem with the SDCC compiler. I tested with the XC8 compiler and worked as it should.

Creo que es un problema con el compilador sdcc. hice pruebas con el compilador XC8 y funciono como debe.
Reply
07-06-2019, 05:20 AM,
#3
RE: LCDi2c.pde It doesn't work as expected.
This is the example I try to run with the SDCC compiler in the Ide12


Code:
const u8 intf = I2C1;
u16 i=996;

void setup()
{
   delay(150);
   TRISAbits.TRISA4 = OUTPUT;//pinMode(USERLED, OUTPUT);
   lcdi2c.init(intf, 16, 2, 0x3F, 4, 3, 2, 1, 0);//modulo hecho por mi(0X3F)
   lcdi2c.noBacklight(intf);          // turns backlight off (for DIY module or DFRobot)
   lcdi2c.clearScreen(intf);          // clear screen
   lcdi2c.home(intf);                 // set cursor at (0,0)
   lcdi2c.print(intf, "lcdi2c demo");
   delay(150);
}

void loop()
{
   lcdi2c.setCursor(intf, 0, 1);     // set cursor at col 0, line 1,
   lcdi2c.printf(intf, "i=%u ", i++);
   /*
   lcdi2c.print(intf, "i=");
   lcdi2c.printNumber(intf, i++, DEC);
   lcdi2c.print(intf, " ");
   */
   LATAbits.LATA4 ^= 1;//toggle(USERLED);// alternate ON and OFF
   delay(250);
}


If anyone has a light thank
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)