s1num=0; P1=0;
write_com(0x80+0x05; write_data(0x20; write_data(0x20; write_data(0x20; write_data(0x20; write_data(0x20; write_data(0x20; write_com(0x80+0x42; write_data(0x20; write_data(0x20; write_data(0x20; write_data(0x20; write_data(0x20; write_data(0x20; } } } if(s2==0 { delay(5; if(s2==0
{
while(!s2; ys++; } } if(s3==0 { delay(5; if(s3==0 {
while(!s3; ys--; } } }
void main( { init(; while(1 {
keyscanf(;
if(s1num==1 //正弦波// {
for(j=0;j<255;j++ {
P0=tosin[j]; delay1(ys; } }
if(s1num==2 //方波// { P0=0xff; delay1(ys; P0=0; delay1(ys; }
if(s1num==3 //三角波// { if(a<128 { P0=a; delay1(ys; } else {
P0=255-a;
delay1(ys; }
a++; }
if(!(s1&s2&s3 { xsf(; } } }
2、输出波形的种类与频率的测试
2.1、测量仪器及测试说明
测量仪器:稳压电源、示波器、数字万用表。