阅读:1060回复:1
[求助]求助!收音头的控制按纽怎么写啊?
小弟在做LC72131的收音头,现在不知道怎么做下去了就是 如果我设置几个按纽,一个键控制FM/AM的切换,二个键控制收台上下调动,那个应该怎么写啊?用C语言怎么写啊?求各位大大指教,小弟刚开始学~~万事开头难!希望大家帮帮,谢谢! 下面这个是我写的5位数码管显示的程序,共阴极的!调试过了,烧到51块子里面也没问题如果谁要用,对应到自己的数码管的位选,输出,和编码自己改下就可以了 #include "REG51.h" #define DISPLAY_DATA P1 sbit LED1 = P2^0; sbit LED2 = P2^1; sbit LED3 = P2^2; sbit LED4 = P2^3; sbit LED5 = P2^4; #define DISPLAYDATA P0 #define U8 unsigned char #define U16 unsigned int #define DELAY_C 100 void Delay(U16 m_data); U8 code DisplayCode[]= { 0xFC,0x60,0xDA,0xF2,0x66,0xB6,0xBE,0xE0,0xFE,0xF6,0xEE,0x3E,0x9C,0x7A,0x9E,0x8E }; main() { P2 = 0xff; while(1) { DISPLAYDATA = DisplayCode[5]; LED1 = 0; Delay(DELAY_C); LED1 = 1; DISPLAYDATA = DisplayCode[6]; LED2 = 0; Delay(DELAY_C); LED2 = 1; DISPLAYDATA = DisplayCode[7]; LED3 = 0; Delay(DELAY_C); LED3 = 1; DISPLAYDATA = DisplayCode[8]; LED4 = 0; Delay(DELAY_C); LED4 = 1; DISPLAYDATA = DisplayCode[9]; LED5 = 0; Delay(DELAY_C); LED5 = 1; }; } void Delay(U16 m_data) { U16 i; for(i=0;i
|
|
1楼#
发布于:2006-11-16 01:28
|
|