⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ss_sweep.lst

📁 在采用 320x240 屏的设计实验箱上运行
💻 LST
📖 第 1 页 / 共 5 页
字号:
              {
              div=7;
              phase=Freq/2.0090;
              }
              if((Freq>=4113)&&(Freq<5759))
              {
              div=5;
              phase=Freq/2.8125;
              }
              if((Freq>=5759)&&(Freq<7199))
              {
              div=4;
              phase=Freq/3.5156;
              }
              if((Freq>=7199)&&(Freq<10104))
              {
              div=3;
              phase=Freq/4.9345;
              }
              if((Freq>=10104)&&(Freq<15157))
              {
              div=2;
C51 COMPILER V8.02   SS_SWEEP                                                              12/07/2007 16:59:16 PAGE 5   

              phase=Freq/7.4017;
              }
              if((Freq>=30316))
              {
              div=1;
              phase=Freq/14.8034;
              }
              #endif
 250   1      P0=phase&0xff;//((unsigned char *)&phase)[1];
 251   1      Mh=0;
 252   1      DC=1;
 253   1      Cmd_CS=1;
 254   1      Cmd_CS=0;
 255   1      Cmd_CS=1;
 256   1      P0=(div<<3)|((phase&0x0700)>>8);//((unsigned char *)&phase)[0];
 257   1      Mh=1;
 258   1      DC=1;
 259   1      Cmd_CS=1;
 260   1      Cmd_CS=0;
 261   1      Cmd_CS=1;
 262   1      }
 263          
 264          void SetCMD(unsigned char Cmd)
 265          {
 266   1      P0=Cmd;
 267   1      DC=0;
 268   1      Cmd_CS=1;
 269   1      Cmd_CS=0;
 270   1      Cmd_CS=1;
 271   1      }
 272          
 273          void refresh_led()
 274          {
 275   1      led_display(10);
 276   1      led_display(value[0]);
 277   1      led_display(value[1]);
 278   1      led_display(value[2]);
 279   1      led_display(value[3]);
 280   1      led_display(value[4]);
 281   1      }
 282          
 283          #define AP 0x2a
 284          
 285          /*
 286          void display_mod(unsigned char mod)
 287          {
 288          Set_Display_Add(768);
 289          printf("MOD:");
 290                  switch(mod)
 291                  {
 292                          case Wsin: printf("SIN    ");
 293                                          break;
 294                          case Wtri: printf("NONE    ");
 295                                          break;
 296                          case Wpul: printf("tiaofu");
 297                                          break;
 298                          case Wclr: printf("NONE ");
 299                                          break;
 300                  }
 301          }*/
 302          void display_mod(unsigned char mod)
 303          {
C51 COMPILER V8.02   SS_SWEEP                                                              12/07/2007 16:59:16 PAGE 6   

 304   1              unsigned int x=264 , y=24;
 305   1              switch(mod)
 306   1              {
 307   2                      case 0:         showchinese(x,y,CD5FD);//正
 308   2                                              x=x+16;
 309   2                                              showchinese(x,y,CCFD2);//弦
 310   2                                              x=x+16;
 311   2                                              showchinese(x,y,CB2A8);//波
 312   2                                              //showchinese(x+16,y,CCFD2);//弦
 313   2                                              //showchinese(x+32,y,CB2A8);//波
 314   2                                              initram_1();
 315   2                                              show_123(1,sin);
 316   2                                              break;
 317   2                      case 1:         showchinese(x,y,CCEDE);//无
 318   2                                              x=x+16;
 319   2                                              showchinese(x,y,CD0C5);//信
 320   2                                              x=x+16;
 321   2                                              showchinese(x,y,CBAC5);//号
 322   2                                              //showchinese(x+16,y,CD0C5);//信
 323   2                                              //showchinese(x+32,y,CBAC5);//号
 324   2                                              initram_1();
 325   2                                              show_123(0,sin);
 326   2                                              break;
 327   2                      case 2:         showchinese(x,y,CCEDE);//无
 328   2                                              x=x+16;
 329   2                                              showchinese(x,y,CD0C5);//信
 330   2                                              x=x+16;
 331   2                                              showchinese(x,y,CBAC5);//号
 332   2                                              //showchinese(x+16,y,CD0C5);//信
 333   2                                              //showchinese(x+32,y,CBAC5);//号
 334   2                                              initram_1();
 335   2                                              show_123(0,sin);
 336   2                                              break;
 337   2                      case 3:         showchinese(x,y,CCEDE);//无
 338   2                                              x=x+16;
 339   2                                              showchinese(x,y,CD0C5);//信
 340   2                                              x=x+16;
 341   2                                              showchinese(x,y,CBAC5);//号
 342   2                                              //showchinese(x+16,y,CD0C5);//信
 343   2                                              //showchinese(x+32,y,CBAC5);//号
 344   2                                              initram_1();
 345   2                                              show_123(0,sin);
 346   2                                              break;
 347   2                      default:        break;
 348   2              }
 349   1              //show_wave(mod);
 350   1      }
 351          
 352          void show_fre(unsigned char a)
 353          {
 354   1              unsigned int x,y ;
 355   1              switch(a)
 356   1              {
 357   2                      case 0://显示频率值
 358   2                              x=264;y=184;
 359   2                              show_num(304,184,CC011);//H
 360   2                              show_num(312,184,CC012);//z
 361   2                              break;
 362   2                      case 1://显示最小值
 363   2                              x=80;y=220;
 364   2                              break;
 365   2                      case 2://显示最大值
C51 COMPILER V8.02   SS_SWEEP                                                              12/07/2007 16:59:16 PAGE 7   

 366   2                              x=128;y=220;//   176
 367   2                              break;
 368   2                      case 3://显示步长或系数
 369   2                              x=216;y=220;//   264
 370   2                              break;
 371   2                      default://清屏
 372   2                              x=264;y=184;
 373   2                              showchinese(x,y,C0000);
 374   2                              x=x+16;
 375   2                              showchinese(x,y,C0000);
 376   2                              x=x+16;
 377   2                              showchinese(x,y,C0000);
 378   2                              x=x+16;
 379   2                              showchinese(x,y,C0000);
 380   2      
 381   2      /*                      showchinese(x+16,y,C0000);
 382   2                              showchinese(x+32,y,C0000);
 383   2                              showchinese(x+48,y,C0000);*/
 384   2      
 385   2                              return;
 386   2                              break;
 387   2               }
 388   1              show_num(x,y,CC000+(value[0]<<4));
 389   1              x=x+8;
 390   1              show_num(x,y,CC000+(value[1]<<4));
 391   1              x=x+8;
 392   1              show_num(x,y,CC000+(value[2]<<4));
 393   1              x=x+8;
 394   1              show_num(x,y,CC000+(value[3]<<4));
 395   1              x=x+8;
 396   1              show_num(x,y,CC000+(value[4]<<4));
 397   1      
 398   1      /*      show_num(x+8,y,CC000+(value[1]<<4));
 399   1              show_num(x+16,y,CC000+(value[2]<<4));
 400   1              show_num(x+24,y,CC000+(value[3]<<4));
 401   1              show_num(x+32,y,CC000+(value[4]<<4));*/
 402   1              
 403   1      }
 404          
 405          void set_up(unsigned char flag)//flag=0,设置;flag=1,频率
 406          {
 407   1              unsigned int x=264,y=144;
 408   1              switch(flag)
 409   1              {
 410   2                      case 0:
 411   2                              showchinese(x,y,CC9E8);//设
 412   2                              x=x+16;
 413   2                              showchinese(x,144,CD6C3);//置
 414   2                              x=x+16;
 415   2                              show_num(x,144,CC010);//:
 416   2      
 417   2      /*                      showchinese(264,144,CC9E8);//设
 418   2                              showchinese(264+16,144,CD6C3);//置
 419   2                              show_num(264+32,144,CC010);//:*/
 420   2      
 421   2                              break;
 422   2                      case 1:
 423   2                              showchinese(x,y,CC6B5);//频
 424   2                              x=x+16;
 425   2                              showchinese(x,144,CC2CA);//率
 426   2                              x=x+16;
 427   2                              show_num(x,144,CC010);//:
C51 COMPILER V8.02   SS_SWEEP                                                              12/07/2007 16:59:16 PAGE 8   

 428   2      
 429   2      /*                      showchinese(264,144,CC6B5);//频
 430   2                              showchinese(264+16,144,CC2CA);//率
 431   2                              show_num(264+32,144,CC010);//:*/
 432   2      
 433   2                              break;
 434   2                      case 2:
 435   2                              showchinese(x,y,C0000);//00
 436   2                              x=x+16;
 437   2                              showchinese(x,144,C0000);//00
 438   2                              x=x+16;
 439   2                              show_num(x,144,C0000);
 440   2      
 441   2      /*                      showchinese(264,144,C0000);//00
 442   2                              showchinese(264+16,144,C0000);//00
 443   2                              showchinese(264+32,144,C0000);*/
 444   2      
 445   2                              break;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -