Hey there
just start working on this OLED, as I work on PICs, I'm writing a library for them.
Yesterday I just draw some pixels, and were Ok on PIC16F886, but when I tried draw a horizontal line and a inclined line, the BYTE erase the first one, So the trick should be read first and then 'OR' the BYTE with the new to draw... sadly there is no READ Operation over I2C from the OLED Display, And that's when I learn why they use a bigger uCronotroller for this s***t
Hola
Acabo de empezar a trabajar en este OLED, ya que trabajo en los PIC, estoy escribiendo una biblioteca para ellos.
Ayer acaba de presento algunas píxeles, y estaban bien en PIC16F886, pero cuando traté de dibujar una línea horizontal y una línea inclinada, la BYTE borrar la primera, Así que el truco debe leerse primero y luego 'OR' BYTE con el nuevo dibujar ... lamentablemente no hay ninguna operación de lectura sobre I2C de la pantalla OLED, y ahí es cuando me entero de por qué utilizan una uCronotroller más grande para este s *** tSo here is so far the Library, just the SetUp and Draw a Pixel so u can apply it meanwhile
Así que aquí es hasta el momento la Biblioteca, sólo la configuración y Dibuje un Pixel, así que puedes aplicarlo mientras tantoExampleOLEDSetUp ( );
ClearOLED ( );
OLEDFill ( 0x00 );
OLEDDisplay ( );
for ( unsigned char i = 15; i < 100; i ++ )
OLEDPixel ( i, 54, WHITE );
// for ( unsigned char i = 15; i < 100; i ++ )
// OLEDPixel ( i, 27, WHITE );
for ( unsigned char i = 1; i < 125; i ++ )
OLEDPixel ( i, i, WHITE );
Library/************ OLED Display.c *********/
#include "OLED Display.h"
char OLEDSetUp ( void )
{
__delay_ms ( 1 ); // As OLDE VDD goes high sooner than VCC,
OLED_RESET_PIN = OFF; // we must wait to stabilize VCC
__delay_ms ( 1 ); // OLED Reset pin.
OLED_RESET_PIN = ON;
// 1. Fundamental Commands.
OLEDCommand ( OLED_SETCONTRAST ); // 0x81
OLEDCommand ( 0x2f ); // was 0x9F.
OLEDCommand ( OLED_DISPLAYALLON_RESUME ); // 0xA5
OLEDCommand ( OLED_NORMALDISPLAY ); // 0xA6
OLEDCommand ( OLED_DISPLAYON );//--turn on oled panel
// 2. Scrolling.
// 3. Addressing.
OLEDCommand ( OLED_MEMORYMODE ); // 0x20
OLEDCommand ( 0x00 );
// 4. Hardware Configuration.
OLEDCommand ( OLED_SETSTARTLINE | 0x00 ); // line #0
OLEDCommand ( OLED_SEGREMAP | 0x01 ); // WTF???
OLEDCommand ( OLED_SETMULTIPLEX ); // 0xA8
OLEDCommand ( 0x3F );
OLEDCommand ( 0xC8 ); // WTF???
OLEDCommand ( OLED_SETDISPLAYOFFSET ); // 0xD3
OLEDCommand ( 0x0 ); // no offset
OLEDCommand ( OLED_SETCOMPINS ); // 0xDA
OLEDCommand ( 0x12 );
// 5. Timing.
OLEDCommand ( OLED_SETDISPLAYCLOCKDIV ); // 0xD5
OLEDCommand ( 0x80 ); // the suggested ratio 0x80
OLEDCommand ( OLED_SETPRECHARGE ); // 0xd9
OLEDCommand ( 0x22 );
OLEDCommand ( OLED_SETVCOMDETECT ); // 0xDB
OLEDCommand ( 0x40 );
// 6?. Other
OLEDCommand ( OLED_CHARGEPUMP ); // 0x8D
OLEDCommand ( 0x10 );
return 0x00;
}
Hopefully the next weekend it is done!!
Esperemos que el próximo fin de semana está hecho !!