❶ 51單片機產生方波,怎麼在5110上顯示方波圖像
51產生的方波,再通過51的中端引腳讀回來,讀的過程中開定時器,然後記錄高低電平時間,通過這個時間在5110上面顯示方波,雖然很難看,也算是功能實現了吧。
❷ nokia5110液晶怎麼和51單片機連接
把電源接上,數據線接在單片機P1、P2、P3上都可以,不加上拉電阻的話最好不要接在P0口上,其他的就是程序的問題了
❸ 如何讓單片機聯網WiFiPro-C5110技術資料
串口轉wifi是可以的,單片機性能太低不能直接接USB模塊或晶元實現wifi功能 這個模塊可參考emw3280 內置tcp/ip,工業級的,效果還不錯
❹ 5110液晶與單片機管腳怎麼樣接
普通的IO口即可,在頭文件裡面申明一下就可以,例如51單片機可以這樣寫
sbit SCLK = P2^5;
sbit SDIN = P2^4;
sbit LCD_DC = P2^3;
sbit LCD_CE = P2^2;
sbit LCD_RST = P2^1;
LPC1114就可以這樣寫
#define LCD_CE PIO1_4
#define LCD_RST PIO1_11
#define LCD_DC PIO3_2
#define LCD_MOSI PIO2_3
#define LCD_CLK PIO3_1
#define LCD_BGL PIO1_5
如果用SPI的話就有固定的引腳了。
❺ 你們有誰知道51單片機和LCD5110的連接圖啊 跪求!!
給你一個程序,看程序你應該會了吧。
#include <reg51.h>
sbit sce = P2^0; //片選
sbit res = P2^1; //復位,0復位
sbit dc = P2^2; //1寫數據,0寫指令
sbit sdin = P2^3; //數據
sbit sclk = P2^4; //時鍾
unsigned char code shuzi[]={
/*-- 文字: 0 --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x0F,0x10,0x20,0x20,0x10,0x0F,0x00,
/*-- 文字: 1 --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x10,0x10,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,
/*-- 文字: 2 --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x70,0x08,0x08,0x08,0x88,0x70,0x00,0x00,0x30,0x28,0x24,0x22,0x21,0x30,0x00,
/*-- 文字: 3 --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x30,0x08,0x88,0x88,0x48,0x30,0x00,0x00,0x18,0x20,0x20,0x20,0x11,0x0E,0x00,
/*-- 文字: 4 --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x00,0xC0,0x20,0x10,0xF8,0x00,0x00,0x00,0x07,0x04,0x24,0x24,0x3F,0x24,0x00,
/*-- 文字: 5 --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0xF8,0x08,0x88,0x88,0x08,0x08,0x00,0x00,0x19,0x21,0x20,0x20,0x11,0x0E,0x00,
/*-- 文字: 6 --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0xE0,0x10,0x88,0x88,0x18,0x00,0x00,0x00,0x0F,0x11,0x20,0x20,0x11,0x0E,0x00,
/*-- 文字: 7 --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x38,0x08,0x08,0xC8,0x38,0x08,0x00,0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00,
/*-- 文字: 8 --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x70,0x88,0x08,0x08,0x88,0x70,0x00,0x00,0x1C,0x22,0x21,0x21,0x22,0x1C,0x00,
/*-- 文字: 9 --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x00,0x31,0x22,0x22,0x11,0x0F,0x00,
/*-- 文字: a --10*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x19,0x24,0x22,0x22,0x22,0x3F,0x20,
/*-- 文字: b --11*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x08,0xF8,0x00,0x80,0x80,0x00,0x00,0x00,0x00,0x3F,0x11,0x20,0x20,0x11,0x0E,0x00,
/*-- 文字: c --12*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x00,0x00,0x80,0x80,0x80,0x00,0x00,0x00,0x0E,0x11,0x20,0x20,0x20,0x11,0x00,
/*-- 文字: d --13*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x00,0x00,0x80,0x80,0x88,0xF8,0x00,0x00,0x0E,0x11,0x20,0x20,0x10,0x3F,0x20,
/*-- 文字: e --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x1F,0x22,0x22,0x22,0x22,0x13,0x00,
/*-- 文字: f --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x80,0x80,0xF0,0x88,0x88,0x88,0x18,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,
/*-- 文字: g --16*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x6B,0x94,0x94,0x94,0x93,0x60,0x00,
/*-- 文字: h --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x08,0xF8,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x3F,0x21,0x00,0x00,0x20,0x3F,0x20,
/*-- 文字: i --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x80,0x98,0x98,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,
/*-- 文字: j --19*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x00,0x00,0x80,0x98,0x98,0x00,0x00,0x00,0xC0,0x80,0x80,0x80,0x7F,0x00,0x00,
/*-- 文字: k --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x08,0xF8,0x00,0x00,0x80,0x80,0x80,0x00,0x20,0x3F,0x24,0x02,0x2D,0x30,0x20,0x00,
/*-- 文字: l --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x08,0x08,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,
/*-- 文字: m --22*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x20,0x3F,0x20,0x00,0x3F,0x20,0x00,0x3F,
/*-- 文字: n --23*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x3F,0x21,0x00,0x00,0x20,0x3F,0x20,
/*-- 文字: o --24*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x1F,0x20,0x20,0x20,0x20,0x1F,0x00,
/*-- 文字: p --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x80,0x80,0x00,0x80,0x80,0x00,0x00,0x00,0x80,0xFF,0xA1,0x20,0x20,0x11,0x0E,0x00,
/*-- 文字: q --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x0E,0x11,0x20,0x20,0xA0,0xFF,0x80,
/*-- 文字: r --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x80,0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x20,0x20,0x3F,0x21,0x20,0x00,0x01,0x00,
/*-- 文字: s --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x33,0x24,0x24,0x24,0x24,0x19,0x00,
/*-- 文字: t --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x80,0x80,0xE0,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x1F,0x20,0x20,0x00,0x00,
/*-- 文字: u --30*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x80,0x80,0x00,0x00,0x00,0x80,0x80,0x00,0x00,0x1F,0x20,0x20,0x20,0x10,0x3F,0x20,
/*-- 文字: v --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x80,0x80,0x80,0x00,0x00,0x80,0x80,0x80,0x00,0x01,0x0E,0x30,0x08,0x06,0x01,0x00,
/*-- 文字: w --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x80,0x80,0x00,0x80,0x00,0x80,0x80,0x80,0x0F,0x30,0x0C,0x03,0x0C,0x30,0x0F,0x00,
/*-- 文字: x --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x31,0x2E,0x0E,0x31,0x20,0x00,
/*-- 文字: y --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x80,0x80,0x80,0x00,0x00,0x80,0x80,0x80,0x80,0x81,0x8E,0x70,0x18,0x06,0x01,0x00,
/*-- 文字: z --35*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x21,0x30,0x2C,0x22,0x21,0x30,0x00,
/*-- 文字: - --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
/*-- 文字: = --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x00,
/*-- 文字: \ --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x0C,0x30,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x06,0x38,0xC0,0x00,
/*-- 文字: --39*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
/*-- 文字: [ --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x00,0x00,0xFE,0x02,0x02,0x02,0x00,0x00,0x00,0x00,0x7F,0x40,0x40,0x40,0x00,
/*-- 文字: ] --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x02,0x02,0x02,0xFE,0x00,0x00,0x00,0x00,0x40,0x40,0x40,0x7F,0x00,0x00,0x00,
/*-- 文字: ; --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x60,0x00,0x00,0x00,0x00,
/*-- 文字: ' --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x10,0x16,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
/*-- 文字: , --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xB0,0x70,0x00,0x00,0x00,0x00,0x00,
/*-- 文字: . --45*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x00,0x00,
/*-- 文字: / --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x00,0x00,0x00,0x80,0x60,0x18,0x04,0x00,0x60,0x18,0x06,0x01,0x00,0x00,0x00,
};
unsigned char code maohao[]={
/*-- 文字: : --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x00,0x00,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00
};
unsigned char code jiaohao[]={
/*-- 文字: + - --48*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x00,0x10,0x10,0x7C,0x10,0x10,0x00,0x00,0x00,0x08,0x08,0x08,0x08,0x08,0x00,
/*-- 文字: + --49*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x00,0x10,0x10,0x7C,0x10,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
/*-- 文字: - --50*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x08,0x08,0x08,0x08,0x00
};
unsigned char code hanzi[]=
{
/*-- 文字: 巍 --*/
/*-- Trebuchet MS8; 此字體下對應的點陣為:寬x高=11x11 --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,
/*-- 文字: 巍 --*/
/*-- Trebuchet MS8; 此字體下對應的點陣為:寬x高=11x11 --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,
/*-- 文字: 機 --*/
/*-- Trebuchet MS8; 此字體下對應的點陣為:寬x高=11x11 --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,
/*-- 文字: 器 --*/
/*-- Trebuchet MS8; 此字體下對應的點陣為:寬x高=11x11 --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,
/*-- 文字: 人 --*/
/*-- Trebuchet MS8; 此字體下對應的點陣為:寬x高=11x11 --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,
};
void delay_1ms(void)//1ms延時函數
{
unsigned int i;
for (i=0;i<500;i++) ;
;
}
/*--------------------------------------------
LCD_write_byte: 使用SPI介面寫數據到LCD
輸入參數:dt:寫入的數據;
command :寫數據/命令選擇;
編寫日期:20080918
----------------------------------------------*/
void LCD_write_byte(unsigned char dt, unsigned char command)
{
unsigned char i;
sce=0;
dc=command;
for(i=0;i<8;i++)
{
if(dt&0x80)
sdin=1;
else
sdin=0;
dt=dt<<1;
sclk=0;
sclk=1;
}
dc=1;
sce=1;
sdin=1;
}
/*---------------------------------------
LCD_init: 3310LCD初始化
編寫日期:20080918
----------------------------------------- */
void LCD_init(void)
{
res=0;
delay_1ms();
res=1;
LCD_write_byte(0x21,0);//初始化Lcd,功能設定使用擴充指令
LCD_write_byte(0xd0,0);//設定液晶偏置電壓
LCD_write_byte(0x20,0);//使用基本指令
LCD_write_byte(0x0C,0);//設定顯示模式,正常顯示
}
/*-------------------------------------------
LCD_set_XY: 設置LCD坐標函數
輸入參數:X:0-83 Y:0-5
編寫日期:20080918
---------------------------------------------*/
void LCD_set_XY(unsigned char X, unsigned char Y)
{
LCD_write_byte(0x40 | Y, 0);// column
LCD_write_byte(0x80 | X, 0);// row
}
/*------------------------------------------
LCD_clear: LCD清屏函數
編寫日期:20080918
--------------------------------------------*/
void LCD_clear(void)
{
unsigned char t;
unsigned char k;
LCD_set_XY(0,0);
for(t=0;t<6;t++)
{
for(k=0;k<84;k++)
{
LCD_write_byte(0x00,1);
}
}
}
/*---------------------------------------------
LCD_write_shu: 顯示8(寬)*16(高)點陣列數字字母符號等半形類
輸入參數:c:顯示的字元;
編寫日期:20080918
-----------------------------------------------*/
void LCD_write_shu(unsigned char row, unsigned char page,unsigned char c) //row:列 page:頁 dd:字元
{
unsigned char i;
LCD_set_XY(row*8, page);// 列,頁
for(i=0; i<8;i++)
{
LCD_write_byte(shuzi[c*16+i],1);
}
LCD_set_XY(row*8, page+1);// 列,頁
for(i=8; i<16;i++)
{
LCD_write_byte(shuzi[c*16+i],1);
}
}
/*---------------------------------------------
LCD_write_hanzi: 顯示16(寬)*16(高)點陣列漢字等半形類
輸入參數:c:顯示的字元;
編寫日期:20080918
-----------------------------------------------*/
void LCD_write_hanzi(unsigned char row, unsigned char page,unsigned char c) //row:列 page:頁 dd:字元
{
unsigned char i;
LCD_set_XY(row*8, page);// 列,頁
for(i=0; i<16;i++)
{
LCD_write_byte(hanzi[c*32+i],1);
}
LCD_set_XY(row*8, page+1);// 列,頁
for(i=16; i<32;i++)
{
LCD_write_byte(hanzi[c*32+i],1);
}
}
main()
{
unsigned char k;
res=0;
for(k=0;k<250;k++);
res=1;
LCD_init(); //初始化LCD模塊
LCD_clear(); //清屏幕
LCD_write_hanzi(0,0,0); //寧
LCD_write_hanzi(2,0,1); //波
LCD_write_hanzi(4,0,2); //單
LCD_write_hanzi(6,0,3); //片
LCD_write_hanzi(8,0,4); //機
LCD_write_hanzi(1,2,5); //開
LCD_write_hanzi(4,2,6); //發
LCD_write_hanzi(7,2,7); //網
LCD_write_shu(1,4,23); //n
LCD_write_shu(2,4,11); //b
LCD_write_shu(3,4,13); //d
LCD_write_shu(4,4,25); //p
LCD_write_shu(5,4,19); //j
LCD_write_shu(6,4,45); //.
LCD_write_shu(7,4,12); //c
LCD_write_shu(8,4,24); //o
LCD_write_shu(9,4,22); //m
while(1)
{
}
}
❻ 單片機中LCD 5110顯示用的代碼,誰能告訴我這是什麼代碼
這是個圖片,這些代碼應該包含在一個數組里,例如:
unsigned char code BMP[]={以上那些數據};當顯示函數調用它時,就顯示一幅圖片。
❼ 怎樣在5110LCD屏上顯示五位數(從0開始遞增)51單片機C程序
#include <reg52.h>
#define uchar unsigned char
#define uint unsigned int
uchar rebuf[11];
uchar tembuf[2]={28,20};
sbit sce = P0^0; //片選
sbit res = P0^1; //復位,0復位
sbit dc = P0^2; //1寫數據,0寫指令
sbit sdin = P0^3; //數據
sbit sclk = P0^4; //時鍾
sbit en = P3^2;
sbit key1 = P1^0;
sbit key2 = P1^1;
sbit key3 = P1^2;
sbit key4 = P1^3;
sbit key5 = P1^4;
sbit key6 = P1^5;
sbit alarm = P2^7;
uchar dp=0,re_data,keynum = 0;
bit full=0,f_alarm=0,m_alarm = 0;
unsigned char code shuzi[]={
/*-- 文字: 0 --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x0F,0x10,0x20,0x20,0x10,0x0F,0x00,
/*-- 文字: 1 --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x10,0x10,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,
/*-- 文字: 2 --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x70,0x08,0x08,0x08,0x88,0x70,0x00,0x00,0x30,0x28,0x24,0x22,0x21,0x30,0x00,
/*-- 文字: 3 --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x30,0x08,0x88,0x88,0x48,0x30,0x00,0x00,0x18,0x20,0x20,0x20,0x11,0x0E,0x00,
/*-- 文字: 4 --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x00,0xC0,0x20,0x10,0xF8,0x00,0x00,0x00,0x07,0x04,0x24,0x24,0x3F,0x24,0x00,
/*-- 文字: 5 --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0xF8,0x08,0x88,0x88,0x08,0x08,0x00,0x00,0x19,0x21,0x20,0x20,0x11,0x0E,0x00,
/*-- 文字: 6 --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0xE0,0x10,0x88,0x88,0x18,0x00,0x00,0x00,0x0F,0x11,0x20,0x20,0x11,0x0E,0x00,
/*-- 文字: 7 --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x38,0x08,0x08,0xC8,0x38,0x08,0x00,0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00,
/*-- 文字: 8 --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x70,0x88,0x08,0x08,0x88,0x70,0x00,0x00,0x1C,0x22,0x21,0x21,0x22,0x1C,0x00,
/*-- 文字: 9 --*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x00,0x31,0x22,0x22,0x11,0x0F,0x00,
/*-- 文字: . --10*/
/*-- 宋體12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x00,0x00,
/*-- 文字: : --11*/
/*-- Trebuchet MS12; 此字體下對應的點陣為:寬x高=8x16 --*/
0x00,0x00,0x00,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,
/*-- 調入了一幅圖像:這是您新建的圖像 --12*/
/*-- 寬度x高度=8x16 --*/
0x0C,0x12,0x0C,0x80,0x40,0x20,0x20,0x20,0x00,0x00,0x00,0x0F,0x10,0x20,0x20,0x20,
};
unsigned char code hanzi[]=
{
/*-- 文字: 光 0--*/
/*-- Trebuchet MS12; 此字體下對應的點陣為:寬x高=16x16 --*/
0x00,0x40,0x42,0x44,0x5C,0xC8,0x40,0x7F,0x40,0xC0,0x50,0x4E,0x44,0x60,0x40,0x00,
0x00,0x80,0x40,0x20,0x18,0x07,0x00,0x00,0x00,0x3F,0x40,0x40,0x40,0x40,0x78,0x00,
/*-- 空白 1--*/
/*-- 寬度x高度=16x16 --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
/*-- 一級光 2--*/
/*-- 寬度x高度=16x16 --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xF0,0xF0,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
/*-- 二級光 3--*/
/*-- 寬度x高度=16x16 --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xF0,0xF0,0xF0,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
/*-- 三級光 4--*/
/*-- 寬度x高度=16x16 --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0xF0,0xF0,0x00,0x00,0x00,0x00,0x00,
0xF0,0xF0,0xF0,0x00,0xFF,0xFF,0xFF,0x00,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,
/*-- 四級光 5--*/
/*-- 寬度x高度=16x16 --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0xF0,0xF0,0x00,0xFF,0xFF,0xFF,0x00,
0xF0,0xF0,0xF0,0x00,0xFF,0xFF,0xFF,0x00,0xFF,0xFF,0xFF,0x00,0xFF,0xFF,0xFF,0x00,
/*-- 文字: 報 6--*/
/*-- Trebuchet MS12; 此字體下對應的點陣為:寬x高=16x16 --*/
0x08,0x08,0x88,0xFF,0x48,0x28,0x00,0xFF,0xC1,0x41,0x41,0x49,0x51,0xCF,0x00,0x00,
0x01,0x41,0x80,0x7F,0x00,0x00,0x00,0xFF,0x40,0x23,0x14,0x1C,0x33,0x60,0x20,0x00,
/*-- 文字: 警 7--*/
/*-- Trebuchet MS12; 此字體下對應的點陣為:寬x高=16x16 --*/
0x20,0x1A,0xFA,0xAF,0xAA,0xEF,0x0A,0xFA,0x10,0x8F,0x54,0x24,0x5C,0x84,0x04,0x00,
0x02,0x02,0x02,0xEA,0xAA,0xAA,0xAB,0xAA,0xAB,0xAA,0xAA,0xEA,0x02,0x02,0x03,0x00,
/*-- 文字: 溫 8--*/
/*-- Trebuchet MS12; 此字體下對應的點陣為:寬x高=16x16 --*/
0x10,0x21,0x86,0x70,0x00,0x7E,0x4A,0x4A,0x4A,0x4A,0x4A,0x7E,0x00,0x00,0x00,0x00,
0x02,0xFE,0x01,0x40,0x7F,0x41,0x41,0x7F,0x41,0x41,0x7F,0x41,0x41,0x7F,0x40,0x00,
/*-- 文字: 度 9--*/
/*-- Trebuchet MS12; 此字體下對應的點陣為:寬x高=16x16 --*/
0x00,0x00,0xFC,0x04,0x24,0x24,0xFC,0xA5,0xA6,0xA4,0xFC,0x24,0x24,0x24,0x04,0x00,
0x80,0x60,0x1F,0x80,0x80,0x42,0x46,0x2A,0x12,0x12,0x2A,0x26,0x42,0xC0,0x40,0x00,
/*-- 文字: 高 10--*/
/*-- Trebuchet MS12; 此字體下對應的點陣為:寬x高=16x16 --*/
0x04,0x04,0x04,0x04,0x74,0x54,0x55,0x56,0x54,0x54,0x74,0x04,0x04,0x04,0x04,0x00,
0x00,0xFF,0x01,0x01,0x3D,0x25,0x25,0x25,0x25,0x25,0x3D,0x41,0x81,0x7F,0x00,0x00,
/*-- 文字: 低 11--*/
/*-- Trebuchet MS12; 此字體下對應的點陣為:寬x高=16x16 --*/
0x40,0x20,0xF0,0x0C,0x07,0x02,0xFC,0x44,0x44,0x42,0xFE,0x43,0x43,0x42,0x40,0x00,
0x00,0x00,0x7F,0x00,0x00,0x00,0x7F,0x20,0x10,0x28,0x43,0x0C,0x10,0x20,0x78,0x00,
};
/************************************************************
延遲函數
函數原型:void delay(uint z)
函數功能:延遲z毫秒
*************************************************************/
void delay(uint z)
{
uint x,y;
for(x=z;x>0;x--)
for(y=110;y>0;y--);
}
/*--------------------------------------------
LCD_write_byte: 使用SPI介面寫數據到LCD
輸入參數:dt:寫入的數據;
command :寫數據/命令選擇;
編寫日期:20080918
----------------------------------------------*/
void LCD_write_byte(unsigned char dt, unsigned char command)
{
unsigned char i;
sce=0;
dc=command;
for(i=0;i<8;i++)
{
if(dt&0x80)
sdin=1;
else
sdin=0;
dt=dt<<1;
sclk=0;
sclk=1;
}
dc=1;
sce=1;
sdin=1;
}
/*---------------------------------------
LCD_init: 3310LCD初始化
編寫日期:20080918
----------------------------------------- */
void LCD_init(void)
{
res=0;
delay(1);
res=1;
LCD_write_byte(0x21,0);//初始化Lcd,功能設定使用擴充指令
LCD_write_byte(0xd0,0);//設定液晶偏置電壓
LCD_write_byte(0x20,0);//使用基本指令
LCD_write_byte(0x0C,0);//設定顯示模式,正常顯示
}
/*-------------------------------------------
LCD_set_XY: 設置LCD坐標函數
輸入參數:X:0-83 Y:0-5
編寫日期:20080918
---------------------------------------------*/
void LCD_set_XY(unsigned char X, unsigned char Y)
{
LCD_write_byte(0x40 | Y, 0);// column
LCD_write_byte(0x80 | X, 0);// row
}
/*------------------------------------------
LCD_clear: LCD清屏函數
編寫日期:20080918
--------------------------------------------*/
void LCD_clear(void)
{
unsigned char t;
unsigned char k;
LCD_set_XY(0,0);
for(t=0;t<6;t++)
{
for(k=0;k<84;k++)
{
LCD_write_byte(0x00,1);
}
}
}
/*---------------------------------------------
LCD_write_shu: 顯示8(寬)*16(高)點陣列數字字母符號等半形類
輸入參數:c:顯示的字元;
編寫日期:20080918
-----------------------------------------------*/
void LCD_write_shu(unsigned char row, unsigned char page,unsigned char c) //row:列 page:頁 dd:字元
{
unsigned char i;
LCD_set_XY(row*8, page);// 列,頁
for(i=0; i<8;i++)
{
LCD_write_byte(shuzi[c*16+i],1);
}
LCD_set_XY(row*8, page+1);// 列,頁
for(i=8; i<16;i++)
{
LCD_write_byte(shuzi[c*16+i],1);
}
}
/*---------------------------------------------
LCD_write_hanzi: 顯示16(寬)*16(高)點陣列漢字等半形類
輸入參數:c:顯示的字元;
編寫日期:20080918
-----------------------------------------------*/
void LCD_write_hanzi(unsigned char row, unsigned char page,unsigned char c) //row:列 page:頁 dd:字元
{
unsigned char i;
LCD_set_XY(row*8, page);// 列,頁
for(i=0; i<16;i++)
{
LCD_write_byte(hanzi[c*32+i],1);
}
LCD_set_XY(row*8, page+1);// 列,頁
for(i=16; i<32;i++)
{
LCD_write_byte(hanzi[c*32+i],1);
}
}
/*---------------------------------------------
void display(): 顯示函數
輸入參數:無;
編寫日期:2009,10
-----------------------------------------------*/
void display()
{
if(rebuf[10]==0xaa)
{
LCD_write_shu(1,0,rebuf[1]); //ID1
LCD_write_shu(2,0,rebuf[2]); //ID2
LCD_write_shu(3,0,rebuf[3]); //ID3
LCD_write_shu(0,2,rebuf[4]); //tem1
LCD_write_shu(1,2,rebuf[5]); //tem2
LCD_write_shu(2,2,10); //.
LCD_write_shu(3,2,rebuf[6]); //tem3
LCD_write_shu(4,2,12); //℃
LCD_write_hanzi(0,4,0); //光
LCD_write_shu(2,4,11); //:
LCD_write_hanzi(3,4,(rebuf[8]+1)); //
if((rebuf[4]>=(tembuf[0]/10))&&(rebuf[5]>=(tembuf[0]%10)))
f_alarm = 1;
else
f_alarm = 0;
if((rebuf[4]<=(tembuf[1]/10))&&(rebuf[5]<=(tembuf[1]%10)))
f_alarm = 1;
else
f_alarm = 0;
}
if(rebuf[10]==0xbb)
{
LCD_write_shu(6,0,rebuf[1]); //ID1
LCD_write_shu(7,0,rebuf[2]); //ID2
LCD_write_shu(8,0,rebuf[3]); //ID3
LCD_write_shu(5,2,rebuf[4]); //tem1
LCD_write_shu(6,2,rebuf[5]); //tem2
LCD_write_shu(7,2,10); //.
LCD_write_shu(8,2,rebuf[6]); //tem3
LCD_write_shu(9,2,12); //℃
LCD_write_hanzi(5,4,0); //光
LCD_write_shu(7,4,11); //:
LCD_write_hanzi(8,4,(rebuf[8]+1)); //
if((rebuf[4]>=(tembuf[0]/10))&&(rebuf[5]>=(tembuf[0]%10)))
m_alarm = 1;
else
m_alarm = 0;
if((rebuf[4]<=(tembuf[1]/10))&&(rebuf[5]<=(tembuf[1]%10)))
m_alarm = 1;
else
m_alarm = 0;
}
}
❽ NOKIA 5110液晶屏與AVR單片機的連接
這些東西是一通n通的,nokia的也好,三星的也好,如果你學會了液晶屏的原理,成功的操作過一種液晶屏的話,只要你有了你這塊屏的數據操作它很簡單。
❾ 51單片機和飛思卡爾單片機的優缺點,還有LCD1602顯示器的顯示原理是什麼,請各位大神幫忙回答我
51單片機是一款入門級別單片機,因為它的資料非常多,非常利於入門的學習,但是這款單片機功耗高,有許多協議不支持。所以是一塊比較適合入門的單片機,
freescale 單片機 大家一般用的都是16位和32位的,現在在高校不是有一個Freescale 智能車大賽嗎?因為比較復雜,就用了Freescale單片機。8位的一般都會用51和AVR,就足夠了。
至於 液晶,液晶按顯示原理,分為字元型和筆劃性,像1602 就是一種字元型的液晶,不能顯示漢字,nokia 5110 就是一塊比較常用的筆畫液晶。
❿ 單片機控制nokia5110屏,復位後有時顯示,有時不顯示,如此不穩定的原因有那些
我用過諾基亞5110顯示屏,不會存在復位有時不顯示,有時顯示。出現你這個的情況很可能是因為復位質量太差,比如復位電壓不高或者復位時電壓毛刺太多,你可以試著復位時按鍵按下的時間長一些,看有無改善。