清达光电北京销售处:
联系人:刘小姐,李小姐,王小姐
Tel:010-62000662,62051209
Fax:010-82036512
Mobile:13701081790
Email:bjqingda@126.com
Web:www.tsingtek.com
联系人:刘小姐,李小姐,王小姐
Tel:010-62000662,62051209
Fax:010-82036512
Mobile:13701081790
Email:bjqingda@126.com
Web:www.tsingtek.com
QQ:453189731
微信:13701081790
地址:北京市海淀区花园东路32号花园公寓A402室
文章详情
清达光电12832点阵OLED显示屏示例程序(SSD1305控制器示例程序)
日期:2024-11-23 02:56
浏览次数:2974
摘要:清达光电为您提供多种OLED显示屏,详情可以QQ 453189731 或者13701081790 刘小姐
---------------------------------------------------------------------------------------------------------------
清达光电12832点阵OLED显示屏示例程序(SSD1305控制器示例程序)如下:
(基于*基本的51单片机)
#include <reg52.h>
#include <intrins.h>
#include <math.h>
#include <stdio.h>
#define lcddata P1
#define uchar unsigned char
#define uint unsigned char
...
清达光电为您提供多种OLED显示屏,详情可以QQ 453189731 或者13701081790 刘小姐
---------------------------------------------------------------------------------------------------------------
清达光电12832点阵OLED显示屏示例程序(SSD1305控制器示例程序)如下:
(基于*基本的51单片机)
---------------------------------------------------------------------------------------------------------------
清达光电12832点阵OLED显示屏示例程序(SSD1305控制器示例程序)如下:
(基于*基本的51单片机)
#include <reg52.h>
#include <intrins.h>
#include <math.h>
#include <stdio.h>
#define lcddata P1
#define uchar unsigned char
#define uint unsigned char
#define I80
sbit RW=P3^1;
sbit E=P3^3;
sbit _WR=P3^1;
sbit _RD=P3^3;
sbit CS=P3^4;
sbit DC=P3^0;
sbit RES=P3^5;
sbit SCLK=P1^0;
sbit SDIN=P1^1;
uchar code tab16[][32]={
/* 点阵:16x16
提取点阵方向:纵向
字节掉转:是
字节方式:C语言 */
0x10,0x22,0x64,0x0C,0xC0,0x44,0x54,0x54, // 清
0x54,0x7F,0x54,0x54,0xD6,0x44,0x40,0x00,
0x04,0x04,0xFE,0x01,0x00,0x00,0xFF,0x15,
0x15,0x15,0x55,0x95,0x7F,0x01,0x00,0x00,
0x40,0x42,0xCC,0x00,0x20,0x20,0x20,0xA0, // 达
0x7F,0x20,0x20,0x20,0x30,0x20,0x00,0x00,
0x40,0x20,0x1F,0x20,0x50,0x48,0x46,0x41,
0x40,0x41,0x42,0x4C,0x58,0x60,0x20,0x00,
0x40,0x40,0x42,0x44,0x58,0xC0,0x40,0x7F, // 光
0x40,0xC0,0x50,0x48,0x46,0x64,0x40,0x00,
0x00,0x80,0x40,0x20,0x18,0x07,0x00,0x00,
0x00,0x3F,0x40,0x40,0x40,0x40,0x70,0x00,
0x00,0x00,0xC0,0x40,0x40,0x40,0x7F,0x48, // 点
0x48,0x48,0x48,0xE8,0x4C,0x08,0x00,0x00,
0x80,0x40,0x37,0x04,0x14,0x64,0x04,0x14,
0x24,0x64,0x04,0x17,0x20,0xC0,0x00,0x00,
0x10,0x22,0x64,0x0C,0x80,0x04,0xC4,0x34, // 液
0x05,0xC6,0xBC,0x24,0x24,0xE6,0x04,0x00,
0x04,0x04,0xFE,0x01,0x02,0x01,0xFF,0x42,
0x21,0x16,0x08,0x15,0x23,0x60,0x20,0x00,
0x00,0x00,0x00,0x00,0xFF,0x49,0x49,0x49, // 晶
0x49,0x49,0xFF,0x00,0x00,0x80,0x00,0x00,
0x00,0xFF,0x49,0x49,0x49,0x49,0xFF,0x00,
0xFF,0x49,0x49,0x49,0x49,0xFF,0x01,0x00,
0x10,0x10,0xD0,0xFF,0x94,0x14,0xE4,0xBF, // 模
0xA4,0xA4,0xA4,0xBF,0xF4,0x26,0x04,0x00,
0x04,0x03,0x00,0xFF,0x08,0x89,0x8B,0x4A,
0x2A,0x1E,0x2A,0x2A,0x4B,0xC8,0x48,0x00,
0x20,0x20,0x20,0xFF,0x20,0x20,0x10,0x10, // 块
0xFF,0x10,0x10,0x10,0xF8,0x10,0x00,0x00,
0x08,0x18,0x08,0x0F,0x84,0x46,0x22,0x1A,
0x07,0x0A,0x12,0x22,0x43,0xC2,0x42,0x00,
};
void uDelay(unsigned char l)
{
while(l--);
}
void delay(unsigned char n)
{
unsigned char i,j,k;
for(k=0;k<n;k++)
{
for(i=0;i<131;i++)
{
for(j=0;j<15;j++)
{
uDelay(80);
}
}
}
}
#ifdef M68 // 8-bit 68XX Parallel
void Writecom(unsigned char Data)
{
DC=0;
CS=0;
RW=0;
E=1;
lcddata=Data;
E=0;
RW=1;
CS=1;
DC=1;
}
void Writedata(unsigned char Data)
{
DC=1;
CS=0;
RW=0;
E=1;
lcddata=Data;
E=0;
RW=1;
CS=1;
DC=1;
}
#endif
#ifdef I80 // 8-bit 80XX Parallel
void Writecom(uchar com)
{
DC=0;
CS=0;
_WR=0;
_nop_();
lcddata=com;
_nop_();
_WR=1;
_nop_();
_nop_();
CS=1;
DC=1;
}
void Writedata(uchar dat)
{
DC=1;
CS=0;
_WR=0;
_nop_();
lcddata=dat;
_nop_();
_WR=1;
_nop_();
_nop_();
CS=1;
DC=1;
}
uchar Readcom()
{
uchar com;
DC=0;
CS=0;
lcddata=0xff;
_RD=0;
_nop_();
_nop_();
com=lcddata;
_RD=1;
_nop_();
_nop_();
CS=1;
DC=1;
return com;
}
uchar Readdata()
{
uchar dat;
DC=1;
CS=0;
lcddata=0xff;
_RD=0;
_nop_();
_nop_();
dat= lcddata;
_RD=1;
_nop_();
_nop_();
CS=1;
DC=1;
return dat;
}
#endif
#ifdef SPI // 4-wire SPI
void Writecom(unsigned char Data)
{
unsigned char i;
CS=0;
DC=0;
for (i=0; i<8; i++)
{
SCLK=0;
SDIN=(Data&0x80)>>7;
Data = Data << 1;
SCLK=1;
}
DC=1;
CS=1;
}
void Writedata(unsigned char Data)
{
unsigned char i;
CS=0;
DC=1;
for (i=0; i<8; i++)
{
SCLK=0;
SDIN=(Data&0x80)>>7;
Data = Data << 1;
SCLK=1;
}
DC=1;
CS=1;
}
#endif
/**********************
主程序
************************/
void main(void)
{
INT();
clear(0xff);
delay(1);
clear(0x55);
delay(1);
clear(0xaa);
delay(1);
reset(0x55);
delay(1);
reset(0xaa);
delay(1);
clear(0x00);
display_8(0,2);
display_8(0,3);
display_16(0,0);
while(1);
}
更详细程序请联系QQ 453189731索取
更详细程序请联系QQ 453189731索取