Pages: [1] 2   Go Down
Author Topic: Serial LCD 128x64 Sparkfun Duda  (Read 3561 times)
0 Members and 1 Guest are viewing this topic.
Alicante
Offline Offline
Sr. Member
****
Karma: 2
Posts: 413
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
#include <serialGLCD.h>
 void setup() {
  Serial.begin(115200); // Default baud rate of the display.
  delay(5000);
 serialGLCD lcd;

}
  void loop() {
serialGLCD lcd;
lcd.gotoLine(11);
  lcd.toggleFont();
  Serial.print("Arduino");

delay(500);
  lcd.clearLCD();

  }


¿Cómo hago para que no aparezca parpadeando 'Arduino'?
Logged

Offline Offline
God Member
*****
Karma: 7
Posts: 635
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

¿Qué tal si eliminas la instrucción en la que estás borrando todos los ciclos el LCD? Elimina:

delay(500);
  lcd.clearLCD();
Logged


Alicante
Offline Offline
Sr. Member
****
Karma: 2
Posts: 413
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

¿Qué tal si eliminas la instrucción en la que estás borrando todos los ciclos el LCD? Elimina:

delay(500);
  lcd.clearLCD();
¿Que queé tal? Pues mal..
Se llena toda la pantalla de Arduino sin parar de refrescarse.
He subido el código con el delay porque ya habría probado quitándolo. ¿Qué de te ocurre?
Gracias por la respuesta !
Logged

Alicante
Offline Offline
Sr. Member
****
Karma: 2
Posts: 413
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Nadie sabe nada?


* la foto.JPG (2745.23 KB, 3264x2448 - viewed 91 times.)
Logged

Alicante
Offline Offline
Sr. Member
****
Karma: 2
Posts: 413
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

¿Nadie?
Logged

Offline Offline
God Member
*****
Karma: 7
Posts: 635
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Sólo se me ocurre leer bien el funcionamiento de esa librería y probar algún ejemplo sencillo que vendrá con la misma.
Logged


Offline Offline
God Member
*****
Karma: 7
Posts: 635
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Tampoco tienes que inicializar la pantalla dentro del bucle, quita "serialGLCD lcd;" de dentro del loop.
También he leído algo sobre la actualización del firmware, viene indicado en el playground de la librería, no sé si ya lo tienes actualizado.

Por último la forma más sencilla de que no aparezca parpadeando es que sólo lo pongas una vez, no es necesario que en todos los ciclos del loop lo vuelvas a poner.
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hola, yo no entiendo mucho, pero deduzco que si lo escribes todo el rato con el loop, siempre van a ocurrir 2 cosas: 1) que se te llene toda la pantalla al quitar el clear. 2) que te parpadee, porque para que no se te llene tendras que limpiar la pantalla con el clear.

Lo correcto seria que lo escribieras una unica vez y no escribieras nada mas ni limpiaras.
Sino para que al limpiar y escribir no se notara el parpadeo, tendria que ser mas rapido el refresco que el ojo humano.

Saludos y suerte.
Logged

Offline Offline
God Member
*****
Karma: 7
Posts: 635
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

hola, yo no entiendo mucho, pero deduzco que si lo escribes todo el rato con el loop, siempre van a ocurrir 2 cosas: 1) que se te llene toda la pantalla al quitar el clear. 2) que te parpadee, porque para que no se te llene tendras que limpiar la pantalla con el clear.

Ahí está lo extraño, no debería llenarse toda la pantalla puesto que antes de escribir le está indicando la posición.
Logged


Alicante
Offline Offline
Sr. Member
****
Karma: 2
Posts: 413
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Siempre he trabajado con LCD serial (de 16x2) y nunca me ha pasado ésto. Quiero decir, que con el código tal cual y mi experiencia con éstas, no debería dar problemas.

Como dice Cheyenne, no debería llenarse toda. Es raro. No sabía nada de la actualización,¿podrías pasarme el enlace? Gracias; a ver si damos con el clavo.
Logged

Offline Offline
God Member
*****
Karma: 7
Posts: 635
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

En el playground en inglés está la librería http://arduino.cc/playground/Code/SerialGLCD
Ahí nombra de un firmware de un tal Jenn Holt's mejorado del original y viene el enlace. No sé si por ahí puede ir la solución.
Logged


Alicante
Offline Offline
Sr. Member
****
Karma: 2
Posts: 413
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

¿Cómo se supone que se actualiza? ¿Con un sketch?
Logged

Alicante
Offline Offline
Sr. Member
****
Karma: 2
Posts: 413
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No se como se actualiza. He leído todo acerca del firmware. ¿Alguien sabe?
Logged

Offline Offline
God Member
*****
Karma: 7
Posts: 635
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Sólo tengo conexión desde el móvil así que no puedo descargarme para ver el firmware. Cuando lo descargas, ¿no incluye algunas instrucciones o similar?
Logged


Alicante
Offline Offline
Sr. Member
****
Karma: 2
Posts: 413
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Si, ya lo había leído todo. Tiene un Readme y aquí os lo pongo:
Quote
Jenn Holt's updated firmware for sparkfun Graphical LCD backpack

This is only for the 128x64 display!!!! I took out all the code for the larger display.
I only own the small one and this was all I could test. others are welcome to adapt the code if they want.

interface stuff:

default baud is still 115200, and will revert to this when a character is sent during the splash screen

** The display now implements XON/XOFF flow control. If your application supports this, you can re-compile the code with a smaller RX_BUFFER_SIZE
   value to make more room for sprites. The default RX_BUFFER_SIZE is the 256 max. If you are going to BitBlt large images I recommend implementing XON/XOFF or you may overrun the buffer. You could also put a delay in your host code if you overrun the buffer while BitBlt'ing a large image.
 
ASCII characters sent to the display will be printed left to right, top to bottom
commands are still prefaced by 0x7C
** there are basic debug messages that get sent when command mode is entered and exited, these are set with command 0x02 0x## with ##=(0,1,2)
        0= no messages, 1=binary format messages, 2=ascii format messages. the messages are sent out on the uart
** there is an LCD reset command that resets the LCD should things get screwy, command 0x06. (pulls /RESET low, then high, clears the screen and sets x_offset=0, y_offset=0)


Text stuff:

**display now responds to carrige returns and line feeds. by default a carrige return also executes a line feed. you can toggle this with command 0x04
**there is no more demo mode
**text rendering is much faster
**you can define your own fonts, however you must decide what fonts you want at compile time. All font data is in two files font.h and aux_font.h, replace them with your own fonts if you wish.
  There is a utility called bmp2header_font which will create a font.h file from a bitmap(one large image with characters sequential in the x direction), not you must manually rename text_array to aux_text array in the header if you want to use it for aux_font.h
**by default the code builds with the original Sparkfun font in default, and a double sized font in aux, you can switch back and forth with command 0x08
**the text is now rendered using the bitblt function, so you can use all the logical modes(0..7) for drawing text, set the mode with command 0x0A 0x##.


Graphical stuff:
**the coordinate system is now (0,0) in upper left and increasing right and down
**the line and circle algorithms have been replaced to use only integer math (Bresenham's line algorithm and midpoint circle algorithm)
**support for NUM_SPRITES sprites labled 0..(NUM_SPRITES-1). each sprite has SPRITE_SIZE bytes of data dedicated to it. 
        the default #defines in the code set these numbers to 8 sprites of 34 bytes each, you can change this if you want, but be careful not
        to use up all the SRAM, the ATmega168 only has 1K. 34 bytes/sprite is enough for a 16x16 block, although sprites don't have to be square.
        command 0c0B draws a sprite, the sparkfun logo is sprite 0, but this can be overwritten. Command 0x0D uploads a sprite.
**draw filled box command. this draws a box filled with a repeating byte(virtical stripe of data) ie 0x00 would clear every pixel, 0xFF would set them, 0xAA would draw stripes
** bitblt if you want to draw something larger than a sprite.
**raw read/write functions: write_command, write_data, write_block, read_data, read_byte, read_block
**reverse mode now inverts the graphics on the screen instead of clearing it.

Command list:
all commands must start with 0x7C, this tells the display that the following bytes are part of a command

0x00:   clear screen, no other bytes (ex 0x7c 0x00)
        clears/sets all pixels on the screen(depending on if reverse is set)
        sets x_offset and y_offset to 0

0x01:   set debug level, follow with byte for debug level(0,1,2)
        level 0 is no messages
        level 1 is binary messages, the display will echo a byte = command when the command is started and a byte = 0x00 when the command is finished
        level 2 is text messages, useful when using a terminal. will echo "Entered Command n" when command n is started
                and will echo "Exited Command n, RX_buffer=y" when the command is done, and will report how many bytes are in the recieve buffer

0x02:   set backling duty cycle. argument is duty cycle in percent ie (0..100) ex: 0x7C 0x02 0x32 will set the backlight to 50%

0x03:   draw circle. arguments are x, y, radius, set/reset. so command (0x7C 0x03 0x20 0x20 0x0A 0x01) will draw a circle at (32,32) with a radius of 10 by setting the pixels

0x04:   toggles CR/LF. each time this command is sent, wheather or not a CR automatically executes a LF is toggled. this is saved to EEPROM and is persistant over power cycles

0x05:   erase block. draws a block on the screen with clear(reverse=0) or set(reverse=1) pixels
        arcuments are x1,y1,x2,y2 the coordinates of two opposite corners of the block. ex: (0x7C 0x05 0x00 0x00 0x10 0x10) clears from (0,0) to (16,16)

0x06:   LCD reset. resets the LCD, clears the screen, and sets x_offset and y_offset to 0

0x07:   change baud rate. 1..6. ex: (0x7C 0x07 0x05) sets baud 57600. this setting is persistant over power cycles.
        1=4800
        2=9600
        3=19200
        4=38400
        5=57600
        6=115200
Logged

Pages: [1] 2   Go Up
Jump to: