-
大小: 42.31MB文件類型: .rar金幣: 1下載: 0 次發布日期: 2023-07-05
- 語言: 其他
- 標簽:
資源簡介
OLED開發例程,0.96寸的OLED,超多資料,非常具有參考價值
代碼片段和文件信息
#include?“oled.h“
#include?“picture.h“
/**********************************************
//IIC?Start
**********************************************/
void?IIC_Start()
{
???SCL?=?high;
???SDA?=?high;
???SDA?=?low;
???SCL?=?low;
}
/**********************************************
//IIC?Stop
**********************************************/
void?IIC_Stop()
{
???SCL?=?low;
???SDA?=?low;
???SCL?=?high;
???SDA?=?high;
}
/**********************************************
//?IIC?Write?byte
**********************************************/
void?Write_IIC_Byte(unsigned?char?IIC_Byte)
{
unsigned?char?i;
for(i=0;i<8;i++)
{
if(IIC_Byte?&?0x80)
SDA=high;
else
SDA=low;
SCL=high;
SCL=low;
IIC_Byte<<=1;
}
SDA=1;
SCL=1;
SCL=0;
}
/**********************************************
//?IIC?Write?Command
**********************************************/
void?Write_IIC_Command(unsigned?char?IIC_Command)
{
???IIC_Start();
???Write_IIC_Byte(0x78);????????????//Slave?addressSA0=0
???Write_IIC_Byte(0x00); //write?command
???Write_IIC_Byte(IIC_Command);?
???IIC_Stop();
}
/**********************************************
//?IIC?Write?Data
**********************************************/
void?Write_IIC_Data(unsigned?char?IIC_Data)
{
???IIC_Start();
???Write_IIC_Byte(0x78); //D/C#=0;?R/W#=0
???Write_IIC_Byte(0x40); //write?data
???Write_IIC_Byte(IIC_Data);
???IIC_Stop();
}
/********************************************
//?fill_Picture
********************************************/
void?fill_picture(unsigned?char?fill_Data)
{
unsigned?char?mn;
for(m=0;m<8;m++)
{
Write_IIC_Command(0xb0+m); //page0-page1
Write_IIC_Command(0x00); //low?column?start?address
Write_IIC_Command(0x10); //high?column?start?address
for(n=0;n<128;n++)
{
Write_IIC_Data(fill_Data);
}
}
}
/******************************************
//?picture用來顯示一個圖片
******************************************/
void?Picture()
{
??unsigned?char?xy;
??unsigned?int?i=0;
??for(y=0;y<8;y++)
????{
??????Write_IIC_Command(0xb0+y);
??????Write_IIC_Command(0x00);
??????Write_IIC_Command(0x10);
??????for(x=0;x<128;x++)
????????{
??????????Write_IIC_Data(show[i++]);
????????}
????}
}
/***********************Delay****************************************/
void?Delay_50ms(unsigned?int?Del_50ms)
{
unsigned?int?m;
for(;Del_50ms>0;Del_50ms--)
for(m=6245;m>0;m--);
}
void?Delay_1ms(unsigned?int?Del_1ms)
{
unsigned?char?j;
while(Del_1ms--)
{
for(j=0;j<123;j++);
}
}
void?Initial_M096128x64_ssd1306()
{
Write_IIC_Command(0xAE);???//display?off
Write_IIC_Command(0x20); //Set?Memory?Addressing?Mode
Write_IIC_Command(0x10); //00Horizontal?Addressing?Mode;01Vertical?Addressing?Mode;10Page?Addressing?Mode?(RESET);11Invalid
Write_IIC_Command(0xb0); //Set?Page?Start?Address?for?Page?Addressing?Mode0-7
Write_IIC_Command(0xc8); //Set?COM?Output?Scan?Direction
Write
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????130??2002-05-11?12:05??OLED客戶資料-1406\128x64取字軟件\128x64取字軟件\asc.ptl
?????文件??????18092??2002-05-15?15:31??OLED客戶資料-1406\128x64取字軟件\128x64取字軟件\Gb2312.PTL
?????文件???????2122??2002-05-12?00:14??OLED客戶資料-1406\128x64取字軟件\128x64取字軟件\notice.txt
?????文件?????310272??2006-10-09?17:04??OLED客戶資料-1406\128x64取字軟件\128x64取字軟件\PCtoLCD2002.exe
?????文件????????406??2014-05-09?09:43??OLED客戶資料-1406\128x64取字軟件\128x64取字軟件\PCtoLCD2002.INI
?????文件???????4427??2002-05-12?00:13??OLED客戶資料-1406\128x64取字軟件\128x64取字軟件\readme2002.txt
?????文件?????676352??2002-02-01?22:00??OLED客戶資料-1406\128x64取字軟件\128x64取字軟件\rtl60.bpl
?????文件????1326080??2002-02-01?22:00??OLED客戶資料-1406\128x64取字軟件\128x64取字軟件\vcl60.bpl
?????文件??????????2??2013-07-13?10:51??OLED客戶資料-1406\128x64取字軟件\128x64取字軟件\_index.txt
?????文件????1739946??2009-06-10?06:55??OLED客戶資料-1406\128x64取字軟件\SAS1-9046-B?UG-2864HSWEG01-Univision.pdf
????I.A....???4165632??2014-05-09?10:05??OLED客戶資料-1406\OLED使用說明.doc
?????文件????4359373??2014-05-09?10:05??OLED客戶資料-1406\OLED使用說明.pdf
?????文件??????10513??2014-04-02?22:58??OLED客戶資料-1406\OLED程序例程\C51_IIC\MOLED
?????文件???????4120??2014-04-02?22:58??OLED客戶資料-1406\OLED程序例程\C51_IIC\MOLED.hex
?????文件?????????59??2014-04-02?22:58??OLED客戶資料-1406\OLED程序例程\C51_IIC\MOLED.lnp
?????文件??????12043??2014-04-02?22:58??OLED客戶資料-1406\OLED程序例程\C51_IIC\MOLED.M51
?????文件??????????0??2014-05-07?10:35??OLED客戶資料-1406\OLED程序例程\C51_IIC\MOLED.plg
?????文件??????73091??2014-04-02?23:04??OLED客戶資料-1406\OLED程序例程\C51_IIC\MOLED.uvgui.Administrator
?????文件??????71496??2014-04-02?18:38??OLED客戶資料-1406\OLED程序例程\C51_IIC\MOLED.uvgui_Administrator.bak
????.......?????74470??2014-05-07?10:36??OLED客戶資料-1406\OLED程序例程\C51_IIC\MOLED.uvopt
????.......?????13411??2014-05-07?10:36??OLED客戶資料-1406\OLED程序例程\C51_IIC\MOLED.uvproj
????.......??????5880??2014-04-02?23:04??OLED客戶資料-1406\OLED程序例程\C51_IIC\MOLED_uvopt.bak
????.......?????13597??2014-04-02?23:04??OLED客戶資料-1406\OLED程序例程\C51_IIC\MOLED_uvproj.bak
?????文件???????7527??2014-04-02?22:58??OLED客戶資料-1406\OLED程序例程\C51_IIC\oled.lst
?????文件??????10026??2014-04-02?22:58??OLED客戶資料-1406\OLED程序例程\C51_IIC\oled.obj
?????文件???????3415??2014-04-02?22:58??OLED客戶資料-1406\OLED程序例程\C51_IIC\OLED_MAIN.lst
?????文件???????1992??2014-04-02?22:58??OLED客戶資料-1406\OLED程序例程\C51_IIC\OLED_MAIN.obj
?????文件???????4141??2014-04-02?22:56??OLED客戶資料-1406\OLED程序例程\C51_IIC\SRC\oled.c
?????文件????????547??2014-04-02?18:05??OLED客戶資料-1406\OLED程序例程\C51_IIC\SRC\oled.h
?????文件???????1728??2014-04-02?22:54??OLED客戶資料-1406\OLED程序例程\C51_IIC\SRC\OLED_MAIN.c
............此處省略1375個文件信息
評論
共有 條評論