《51单片机 电子琴 简单容易理解 程序》由会员分享,可在线阅读,更多相关《51单片机 电子琴 简单容易理解 程序(2页珍藏版)》请在金锄头文库上搜索。
#include #include #define uint unsigned int #define uchar unsigned char sbit SPK= P37; uint FreqTemp; unsigned int code Freqtab = 64021,64103,64260,64400, 64524,64580,64684,64777, 64820,64898,64968,65030, 65058,65110,65157,65178; uchar Keyscan(void) uchar i, j, temp, Buffer4 = 0xfe, 0xfd, 0xfb, 0xf7; for(j = 0; j = 1; return 16; void Display(uchar k) P2 = (k / 10) 8; SPK = SPK;