求: 用51单片机c语言操作使蜂鸣器奏出“祝你生日快乐”音乐的全部程序...答:include <reg51.h> sbit speaker=P1^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,...
PIC16F877A的4*4矩阵式按键程序该怎么写答:两个并行口中,一个输出扫描码,使按键逐行动态接地,另一个并行口输入按键状态,由行扫描值和回馈信号共同形成键编码而识别按键,通过软件查表,查出该键的功能。程序框图图4.14.3汇编源程序KEYBUF EQU 30H ORG 00HSTART: MOV KEYBUF,#2WAIT: MOV P3,#0FFH CLR P3.4 MOV A,P3 ANL A,#0FH XRL A,#0FH ...
求一单片机(C51)的简易计算器程序,能实现加减乘除。答:MOV P2,#00H MOV SCANLED,#0 MOV 33H,#0H MOV 34H,#0H MOV 35H,#0H MOV 36H,#0H MOV S_DAT,#0 MOV D_DAT,#0 CLR FLAG SETB EA SETB ET0 SETB TR0 LOOP:LCALL KEYSEL MOV A,KEYVAL CJNE A,#0FFH,LOOP1 SJMP LOOP LOOP1:CJNE A,#11,LOOP2 ;“=”MOV A,33H MOV B...