OLED程序
單片機源程序如下:
- /********************************************
- OLED屏測試程序-STC&89C52
- *********************************************************/
- #include "REG51.h"
- #include "intrins.h"
- #include "codetab.h"
- #include "LQ12864.h"
- /********************(STC12C5608AD 11MHZ z=1時精確延時1ms)*******************/
- void delayms(unsigned int z)
- {
- unsigned int x,y;
- for(x=z; x>0; x--)
- for(y=1848; y>0; y--);
- }
- /*********************主函數************************************/
- void main(void)
- {
- unsigned char i;
- LCD_Init(); //oled 初始化
- while(1)
- {
- Draw_BMP(0,0,64,8,BMP); //圖片顯示
- LCD_P16x161Ch(64,3,0);
- LCD_P16x161Ch(80,3,1);
- LCD_P16x161Ch(96,3,2);
- LCD_P16x161Ch(112,3,3);
- LCD_P6x8Str(66,6,"MyDigit.cn");
- delayms(3000);
- LCD_CLS();
- for(i=0; i<8; i++)
- {LCD_P16x16Ch(i*16,0,i); //點陣顯示
- LCD_P16x16Ch(i*16,2,i+8);
- LCD_P16x16Ch(i*16,4,i+16);
- LCD_P16x16Ch(i*16,6,i+24);
- }
- delayms(3000);
- LCD_CLS();
- LCD_P8x16Str(44,2,"O K!");
- LCD_P8x16Str(20,0,"OLEDDISPLAY");
- LCD_P8x16Str(24,4,"QQ:568983008");
- ……………………
- …………限于本文篇幅 余下代碼請從51黑下載附件…………
復制代碼
所有資料51hei提供下載:
C51 驅動OLED.rar
(57.39 KB, 下載次數: 62)
2017-7-2 10:30 上傳
點擊文件名下載附件
|