成人无码特黄特黄av片在线丨天堂中文在线资源库用丨亚洲国产天堂一区二区三区丨91麻豆国产福利精品丨精品女同在线一区二区

文章詳情

1602寬溫字符OLED顯示模塊HCS1626測試程序

日期:2025-07-19 13:55
瀏覽次數:1640
摘要:HCS1626是字符型OLED顯示模塊工作溫度-40~80℃,清達光電HCS1626完全兼容普通字符液晶,黑底黃字效果。

清達光電為您提供HCS1626寬溫字符OLED顯示屏,工作溫度為-40~80℃,外形尺寸和定位尺寸兼容普通的1602字符液晶,指令集也兼容普通的字符1602液晶,下面為1602寬溫字符OLED顯示模塊HCS1626測試程序(因篇幅限制,某些子程序未放入,可以咨詢清達光電索取)

#include<reg51.h>

#include <string.h>

#include <intrins.h>

#include <math.h>

#define uchar unsigned char

#define uint unsigned int

#define P68

#define DATA P1

sbit CD = P3^3;  //并行接口;

sbit WR1 = P3^1;

sbit RD1 =   P3^0;

sbit SCL =P1^0; //I2C接口;

sbit SDA =P1^1;

sbit SCLK =P1^0; //SPI接口;

sbit SDIN =P1^1;

sbit SDOU =P1^2;


/******************************************************************

 初始化設置;

*****************************************************************/

void init(void)

{

     delay(50);

//  RES=1;delay(5);

//  RES=1;delay(5);

//  RES=1;delay(5);  

// 設置電源模式;

     wr_com(0x2a);

     wr_com(0x71);

     wr_data(0x00);  /* 設置為3.3V模式 */

     wr_com(0x28);

// 顯示開關;

     wr_com(0x08);  /* 關顯示 */

// 設置Fosc和DCLK;

     wr_com(0x2a);

     wr_com(0x79);

 wr_com(0xd5);

 wr_com(0x70);      /* Fosc=7 DCLK=1 */

 wr_com(0x78);

 wr_com(0x28);

// 設置顯示模式;

     wr_com(0x2a);

     wr_com(0x08); /* 字寬=5   1/2行顯示 */

 wr_com(0x28);

// 設置地圖模式;

     wr_com(0x2a);

     wr_com(0x06);    /* BDC=1(C0-->C31)   BDS=0(S99-->S0) (已規定,客戶不可自行修改) */

 wr_com(0x28);

// 選擇內部ROM和CGRAM;

     wr_com(0x2a);

     wr_com(0x72);

 wr_data(0x00); /* ROM=A  CGRAM=8 */

 wr_com(0x28);

// 設置OLED特性;

     wr_com(0x2a);

     wr_com(0x79); /* 進入OLED設置 */

 wr_com(0xda);

 wr_com(0x10); /* SEG硬件結構  (已規定,客戶不可自行修改) */

 wr_com(0xdc);

 wr_com(0x00);  /* 內部VSL  GPIO輸出無效 */

 wr_com(0x81);

 wr_com(0x7f); /* 共256級對比度,選一半 */

 wr_com(0xd9);

 wr_com(0xf1); /* P2=15DCLK  P1=4DCLK */

 wr_com(0xdb);

 wr_com(0x30); /* Vcom=0.83Vcc  */

 wr_com(0x78);

 wr_com(0x28);     /* 退出OLED設置 */

//準備開顯示;

 wr_com(0x01);    /*  清屏 */

 delay(5);

 wr_com(0x80); /*  設置DDRAM地址  */

 wr_com(0x0c); /*  開顯示 */

}

/******************************************************************

 主程序;

*****************************************************************/

int main(void)

{

CD=0;

init();

CGR_SET(CGR);

while(1)

{

fill(0x00);delay(700);

fill(0x01);delay(700);

fill(0x02);delay(700);

fill(0x03);delay(700);

clear();

en_c_r(0,0,tab1);

en_c_r(0,1,tab2);delay(700);

}

}

主站蜘蛛池模板: 颍上县| 云南省| 溧阳市| 武威市| 西贡区| 安国市| 顺平县| 盈江县| 酉阳| 道孚县| 天长市| 前郭尔| 东宁县| 武平县| 京山县| 梧州市| 固始县| 大石桥市| 宝丰县| 宣武区| 台东县| 茂名市| 沾化县| 炉霍县| 丹阳市| 连州市| 闸北区| 前郭尔| 庆城县| 泰顺县| 长垣县| 平原县| 昭平县| 甘洛县| 抚松县| 神池县| 夏邑县| 邯郸县| 汽车| 运城市| 大厂|