用单片机实现一个简易电子琴,8个按键代表8个音符,用汇编或C语言。51程...答:include<AT89X51.H>unsigned char table[]={0x3f,0x60,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71};unsigned char temp;unsigned char key;unsigned char i,j;unsigned char STH0;unsigned char STL0;unsigned int code tab[]={64021,64103,64260,...
求一个用C语言编写的51单片机音乐程序代码。答:include <reg52.h> sbit speaker=P2^2;unsigned char timer0h,timer0l,time;//生日歌 code unsigned char sszymmh[]={5,1,1, 5,1,1, 6,1,2, 5,1,2, 1,2,2, 7,1,4,5,1,1, 5,1,1, 6,1,2, 5,1,2, 2,2,2, 1,2,4,5,1,1, 5,1,1, 5,2,2, 3,2,2,...
...使电子琴发出do,re,mi,fa,so,la,si,deo(用单片机汇编语言编程 用蜂 ...答:这是以前写的,用的是P0口。T0HEQU 30H T0L EQU 31H ORG 0000H LJMP MAIN ORG 000BH LJMP T0ISR ORG 0030H MAIN:MOV SP,#5FH MOV TMOD,#01H SETB ET0 SETB EA LOOP:MOV DPTR,#FREQ MOV A,P2;控制高中低音区 MOV R1,#0 ANL A,#03H JB ACC.0,LOOP01 MOV R1,#14 SJMP LOOP0...