標(biāo)題: STC89C51+OLED12864+源代碼+取字軟件 [打印本頁(yè)]

作者: 456456456....    時(shí)間: 2019-8-23 08:31
標(biāo)題: STC89C51+OLED12864+源代碼+取字軟件
  1. main函數(shù)
  2. /*************************************************************************************
  3. * 2019/8/22
  4. *第一個(gè)界面顯示“單片機(jī)最小系統(tǒng)”
  5. *第二個(gè)界面顯示“我”
  6. *第三個(gè)界面顯示“喜”
  7. *第四個(gè)界面顯示“歡”
  8. *第五個(gè)界面顯示“你”
  9. *第六個(gè)界面顯示“心形”
  10. *************************************************************************************/
  11. #include "reg52.h"
  12. #include "intrins.h"
  13. #include "codetab.h"
  14. #include "LQ12864.h"
  15. unsigned char i;

  16. void main(void)
  17. {
  18.         OLED_Init(); //OLED初始化
  19.         while(1)
  20.         {               
  21.                 for(i=0; i<7; i++)//通過(guò)點(diǎn)整顯示漢字 -- i表示字表數(shù)組的位置
  22.                 {
  23.                         OLED_P16x16Ch(i*16,0,i);    //第一行
  24.                          OLED_P16x16Ch(i*16,2,i+7);  //第二行
  25.                          OLED_P16x16Ch(i*16,4,i+14); //第三行
  26.                          OLED_P16x16Ch(i*16,6,i+21); //第四行
  27.                 }
  28.                 delay(1000);
  29.                 Draw_BMP(0,0,128,8,BMP0);//我
  30.                 delay(1000);
  31.                 Draw_BMP(0,0,128,8,BMP1);//喜
  32.                 delay(1000);
  33.                 Draw_BMP(0,0,128,8,BMP2);//歡
  34.                 delay(1000);
  35.                 Draw_BMP(0,0,128,8,BMP3);//你
  36.                 delay(1000);
  37.                 Draw_BMP(0,0,128,8,BMP4);//心
  38.                 delay(1000);
  39.                 OLED_Fill(0xff); //屏全亮
  40.                 delay(500);
  41.                 OLED_Fill(0x55); //屏半亮
  42.                 delay(500);
  43.                 OLED_Fill(0x00); //屏全滅
  44.                 delay(500);
  45.   }

  46. }
復(fù)制代碼


oled.zip

983.94 KB, 下載次數(shù): 113, 下載積分: 黑幣 -5






歡迎光臨 (http://www.torrancerestoration.com/bbs/) Powered by Discuz! X3.1