* 晶振:8M */ #include #include #define ChannelCount 50 //最多支持多少个台,因为常驻内存,多了RAM 放不下 #define uchar unsigned char #define uint unsigned int typedef struct { uchar Freq; uchar Rssi; }ChannelInfo; sbit SDA = P2^0; sbit SCL = P2^1; sbit key1 = P3^4; sbit key2 = P2^7; sbit key3 = P2^6; sbit key4 = P2^5; // P3^7; sbit LcdEn = P3^4; sbit LcdRs = P3^5; uchar Channel = 0; uchar FreqTune = 0; const uint MinFreq = 870; //起始频率 * 100KHz const uint MaxFreq = 1080; //最高频率 * 100KHz const uchar FmAddr = 0×22; //FM 模块 IIC 地址 const uchar EpAddr = 0xA0; //24C02 EPPRom 的地址 uchar RSSI = 0; //信号强度 uchar ChannelTune[ChannelCount]; uchar code LevlChar[5][8] = {{0x1F,0×11,0x0A,0×04,0×04,0×04,0×04,0×04}, {0×00,0×00,0×00,0×00,0×00,0×00,0×06,0x1E}, {0×00,0×00,0×00,0×00,0×06,0x1E,0x1E,0x1E}, //显示型号强度的自定义字符 {0×00,0×00,0×06,