欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136
標題:
自己整理的OLED STM32 spi方式代碼
[打印本頁]
作者:
songyuan
時間:
2019-3-11 20:44
標題:
自己整理的OLED STM32 spi方式代碼
STM32 OLED12864 spi方式
單片機源程序如下:
#include "sys.h"
#include "delay.h"
#include "usart.h"
#include "led.h"
#include "OLED.h"
/***********************iBoxV300*********************************
\\\|///
\\ - - //
( @ @ )
+---------------------oOOo-(_)-oOOo-------------------------+
| |
| Oooo |
+-----------------------oooO--( )-------------------------+
( ) ) /
\ ( (_/
\_)
****************************************************************/
/*
stm32與OLED屏接口的引腳介紹:
CS——---——GPIOD3;
RST——--——GPIOD4;
DC———-——GPIOD5;
D0———-——GPIOD6;
D1———-——GPIOD7;
*/
const unsigned char xing[]=
{ 0x10,0x40,0x10,0x22,0xF0,0x15,0x1F,0x08,
0x10,0x16,0xF0,0x21,0x40,0x40,0x3C,0x42,
0x10,0x42,0x10,0x42,0xFF,0x7F,0x10,0x42,
0x10,0x42,0x10,0x42,0x00,0x40,0x00,0x00};/*"姓",0*/
const unsigned char A[]=
{ 0x00,0x20,0x00,0x3C,0xC0,0x23,0x38,0x02,
0xE0,0x02,0x00,0x27,0x00,0x38,0x00,0x20};/*"A",0*/
const unsigned char ming[]=
{ 0x00,0x04,0x20,0x04,0x20,0x04,0x10,0x02,
0x08,0xFE,0x14,0x43,0x67,0x43,0x84,0x42,
0x44,0x42,0x24,0x42,0x14,0x42,0x0C,0x42,
0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00};/*"名",0*/
const unsigned char ASCII_Colon[]=
{ 0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x30,
0xC0,0x30,0x00,0x00,0x00,0x00,0x00,0x00};/*":",0*/
const unsigned char xue[]=
{ 0x40,0x04,0x30,0x04,0x11,0x04,0x96,0x04,
0x90,0x04,0x90,0x44,0x91,0x84,0x96,0x7E,
0x90,0x06,0x90,0x05,0x98,0x04,0x14,0x04,
0x13,0x04,0x50,0x04,0x30,0x04,0x00,0x00};/*"學",0*/
const unsigned char hao[]=
{ 0x80,0x00,0x80,0x00,0x80,0x00,0xBE,0x06,
0xA2,0x05,0xA2,0x04,0xA2,0x04,0xA2,0x04,
0xA2,0x44,0xA2,0x84,0xA2,0x44,0xBE,0x3C,
0x80,0x00,0x80,0x00,0x80,0x00,0x00,0x00};/*"號",0*/
/*********************************************************/
int main(void)
{
// SysTick_Init();
OLED_Init();
OLED_ShowChinese(0, 0, xing);//‘姓’
OLED_ShowChinese(18, 0, ming);//‘名’
OLED_ShowChar(36, 0, ASCII_Colon);//‘:’
OLED_ShowChinese(0, 2, xue);//‘學’
OLED_ShowChinese(18, 2, hao);//‘號’
OLED_ShowChar(36, 2, ASCII_Colon);//‘:’
// SPI_Write(0x2F, OLED_Order); //0x2F:激活滾動 0x2E:關閉滾動
// //設置滾動方式:
// // 0x26/0x27 :水平滾動(右向/左向)
// // 0x29/0x2A :水平和垂直滾動(右向/左向)
// // 0xA3 :垂直滾動
// SPI_Write(0x27, OLED_Order);
// SPI_Write(0x00, OLED_Order);
// SPI_Write(0x00, OLED_Order);
// SPI_Write(0x00, OLED_Order);
// SPI_Write(0x03, OLED_Order);
// SPI_Write(0x30, OLED_Order);
while(1);
}
/**************************************************************/
復制代碼
所有資料51hei提供下載:
OLED.7z
(180.79 KB, 下載次數(shù): 71)
2019-3-12 01:10 上傳
點擊文件名下載附件
下載積分: 黑幣 -5
歡迎光臨 (http://m.raoushi.com/bbs/)
Powered by Discuz! X3.1