8051單片機(jī)紅外線遙控實(shí)驗(yàn)
如果網(wǎng)頁(yè)顯示格式錯(cuò)亂可從這里下載完整的源程序:http://www.51hei.com/f/dpjjmhw.rar
//遙控器采用Ht6221芯片
//紅外線遙控 用外部中斷作為紅外線解碼輸入 紅外遙控器1號(hào)鍵為電風(fēng)扇啟動(dòng)鍵
#include
#define uchar unsigned char
#define uint unsigned int
code uchar seg[]={0x28,0x7e,0xa2,0x62,0x74,0x61,0x21,0x7a,0x20,0x60}; //數(shù)碼管碼表
code uchar tab[]={0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe}; //數(shù)碼管位選
#define uint unsigned int
code uchar seg[]={0x28,0x7e,0xa2,0x62,0x74,0x61,0x21,0x7a,0x20,0x60}; //數(shù)碼管碼表
code uchar tab[]={0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe}; //數(shù)碼管位選
code uchar ss[]={0x10,0x03,0x01,0x06,0x09,0x1d,0x1f,0x0d,0x19,0x1b,0x11,0x15,0x17,0x12,0x16,0x4c,0x40,0x48,0x04,0x00,
0x02,0x05,0x54,0x4d,0x0a,0x1e,0x0e,0x1a,0x1c,0x14,0x0f,0x0c}; //紅外線鍵碼1--32
0x02,0x05,0x54,0x4d,0x0a,0x1e,0x0e,0x1a,0x1c,0x14,0x0f,0x0c}; //紅外線鍵碼1--32
void delay(uint k)
{
while(k--);
}
{
while(k--);
}
void show(uint k) //顯示數(shù)值
{
uchar i=0,j;
uchar s[4]; //顯示最終位數(shù)
do
{
s[i++]=k%10; //數(shù)據(jù)分離
{
uchar i=0,j;
uchar s[4]; //顯示最終位數(shù)
do
{
s[i++]=k%10; //數(shù)據(jù)分離
}while(k/=10);
關(guān)鍵詞:
8051單片機(jī)紅外線遙
相關(guān)推薦
技術(shù)專區(qū)
- FPGA
- DSP
- MCU
- 示波器
- 步進(jìn)電機(jī)
- Zigbee
- LabVIEW
- Arduino
- RFID
- NFC
- STM32
- Protel
- GPS
- MSP430
- Multisim
- 濾波器
- CAN總線
- 開(kāi)關(guān)電源
- 單片機(jī)
- PCB
- USB
- ARM
- CPLD
- 連接器
- MEMS
- CMOS
- MIPS
- EMC
- EDA
- ROM
- 陀螺儀
- VHDL
- 比較器
- Verilog
- 穩(wěn)壓電源
- RAM
- AVR
- 傳感器
- 可控硅
- IGBT
- 嵌入式開(kāi)發(fā)
- 逆變器
- Quartus
- RS-232
- Cyclone
- 電位器
- 電機(jī)控制
- 藍(lán)牙
- PLC
- PWM
- 汽車電子
- 轉(zhuǎn)換器
- 電源管理
- 信號(hào)放大器
評(píng)論