Esempio n. 1
0
void Display_Picture(unsigned char pic[])
{
	unsigned char i,j,num=0;
	for(i=0;i<0x04;i++)
	{
		Set_Page_Address(i);
		Set_Column_Address(0x00);

		i2cstart();
		write_w(0x78);

		write_w(0x40);
		for(j=0;j<0x40;j++)
		{
			write_w(pic[i*0x40+j]);
		}
		i2cstop();
	}
	return;
}
void SSD1306_display(void) {
    
    unsigned char i, j;
    for (i = 0; i < 0x08; i++)
    {
        Set_Page_Address(i);
        // Set_Column_Address(0x00);
        OLED_M_command(0x10);
        OLED_M_command(0x40);
        for (j = 0; j < 0x60; j++)
        {
            OLED_M_data(buffer[i * 0x60 + (0x5f-j)]);
        }
    }
    
    
//    OLED_M_command(COLUMNADDR);
//    OLED_M_command(0x0);
//    OLED_M_command(0x0);
////    OLED_M_command(0x7F);
//
//    OLED_M_command(PAGEADDR);
//    OLED_M_command(0x0);
//    OLED_M_command(0x0);
////    OLED_M_command(0x7);
//    uint16_t i;
//    for ( i=0; i<(96*39/8); i++) {
//      // send a bunch of data in one xmission
//      uint8_t x;
//      for ( x=0; x<16; x++) {
//        OLED_M_data(buffer[i]);
//        i++;
//      }
//      i--;
//      
//    }
//

}