【资源下载】下载地址如下:
https://docs.qq.com/doc/DTlRSd01BZXNpRUxl
#include"reg51.h" #define uchar unsigned char sbit ksaw=P1^0; //锯齿波按键. sbit ktran=P1^1; //三角波按键. sbit ksquare=P1^2; //方波按键. sbit ksin=P1^3; //正弦波按键. void delay( ); uchar code tab[128]={ 64,67,70,73,76,79,82,85,88,91,94,96,99,102,104,106, 109,111,113,115,117,118,120,121,123,124,125,126,126, 127,127,127,127,127,127,127,126,126,125,124,123,121, 120,118,117,115,113,111,109,106,104,102,99,96,94,91, 88,85,82,79,76,73,70,67,64,60,57,54,51,48,45,42,39, 36,33,31,28,25,23,21,18,16,14,12,10,9,7,6,4,3,2,1, 1,0,0,0,0,0,0,0,1,1,2,3,4,6,7,9,10,12,14,16,18,21,23, 25,28,31,33,36,39,42,45,48,51,54,57,60}; void delay( ) { uchar i; for(i=0;i<255;i++); } void saw(void) //锯齿波. { uchar i; while(1)