olikraus / U8glib_Arduino

U8glib library for Arduino
Other
161 stars 84 forks source link

SSD1306 Contrast Fix, same as 1309 #6

Closed openSoftMan closed 8 years ago

openSoftMan commented 8 years ago

Greetings,

I added this to u8g_dev_ssd1306_128x64.c per your fix for the 1309 and u8g.setContrast() works now :

tested with these 2 inits: U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_DEV_0|U8G_I2C_OPT_NO_ACK|U8G_I2C_OPT_FAST); U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NO_ACK);

case U8G_DEV_MSG_CONTRAST: u8g_SetChipSelect(u8g, dev, 1); u8gSetAddress(u8g, dev, 0); /* instruction mode / u8g_WriteByte(u8g, dev, 0x081); u8gWriteByte(u8g, dev, ((uint8t )arg) ); /_ 11 Jul 2015: fixed contrast calculation */ u8g_SetChipSelect(u8g, dev, 0);
return 1;

Thanks!

olikraus commented 8 years ago

looks like that this is already implemented. Please not that this is only the arduino copy of the real github project, which is u8glib