Fear-Bravo / u8glib

Automatically exported from code.google.com/p/u8glib
Other
0 stars 0 forks source link

Not right setup contrast for driver u8g_dev_ssd1309_128x64_fn #327

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Not right setup contrast for driver u8g_dev_ssd1309_128x64_fn

File "u8g_dev_ssd1309_128x64.c"

uint8_t u8g_dev_ssd1309_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void 
*arg)
{
...
    case U8G_DEV_MSG_CONTRAST:
      u8g_SetChipSelect(u8g, dev, 1);
      u8g_SetAddress(u8g, dev, 0);          /* instruction mode */
      u8g_WriteByte(u8g, dev, 0x081);
>>>>> u8g_WriteByte(u8g, dev, (*(uint8_t *)arg) >> 2);
      u8g_SetChipSelect(u8g, dev, 0);      
      return 1; 
...
}

u8g_WriteByte(u8g, dev, (*(uint8_t *)arg) >> 2) - not right,

must be

u8g_WriteByte(u8g, dev, (*(uint8_t *)arg));

Original issue reported on code.google.com by D.Sheshu...@gmail.com on 4 Mar 2015 at 8:07

GoogleCodeExporter commented 8 years ago
Correct. Thanks for the bugfix.

From the datasheet:
10.7
Set Contrast Control for BANK0 (81h)
This command sets the Contrast Setting of the display. The chip has 256 
contrast steps from 00h to FFh. The
segment output current increases as the contrast step value increases. 

Original comment by olikr...@gmail.com on 6 Mar 2015 at 5:25