广告

原创 数控电源proteus程序

2009-5-14 11:08 2134 1 1 分类: MCU/ 嵌入式

http://space.ednchina.com/Upload/2009/5/14/bfa1fd2b-3204-4742-9206-bab0a79edbf3.rar#include <reg51.h>
#include "keyscan.h"
#include "LCD1602.h"
#include "stdio.h"
unsigned char tab []={0xc0,0xf9,0xa4,0xb0,0x99,0x92, 0x82,0xf8,0x80,0x90,0xff}; //共阳数码管段码


 float fec;
   void Delay1ms(unsigned int count)
{
 unsigned int i,j;
 for(i=0;i<count;i++)
 for(j=0;j<120;j++);
}
void main ()
{
    unsigned char buffer[40];
  while (1)
    {
       linscan ();
       rowscan ();
       temp="lin"*4+row;
  P0 = tab [temp];
       
        switch (temp)
        {
    case 0:  P1 = 25; fec="1";  break;
     case 1:  P1 = 50; fec="2";  break;
     case 2:  P1 = 75; fec="3";  break;
     case 3:  P1 = 100; fec="4";  break;
    case 4:  P1 = 125; fec="5";  break;
    case 5:  P1 = 150; fec="6";  break;
    case 6:  P1 = 175; fec="7";  break;
    case 7:  P1 = 200; fec="8";  break;
    case 8:  P1 = 225; fec="9";  break;
    case 9:  P1 = 250; fec="10";  break;
    case 10: P1 = 0X01; fec="3";  break;
        }
     LCD_Initial();
       GotoXY(4,0);
      Print(" Volt");
    GotoXY(0,1);
      Print(" Volt");
 
     
     GotoXY(7,1);  
     sprintf(buffer,"%4.1f  V",fec);
     Print(buffer);
     Delay1ms(200);
          
     
}
}

广告

文章评论 0条评论)

登录后参与讨论
相关推荐阅读
aas7502987 2012-04-07 11:48
51/STC最小系统板资料(更新中)
图片欣赏    淘宝网址:http://item.taobao.com/auction/item_detail.htm?item_num_id=9073446988  二   程...
aas7502987 2011-10-13 22:59
YL-3 资料
YL-3数码管模块资料:YL-3 串行数码管资料.zip...
aas7502987 2011-09-24 09:10
USB转TTL小板驱动
xp系统驱动:XP系统支持STC下载的PL-2303HX新版驱动.rar WIN7系统驱动:WIN7系统支持STC下载的PL2303HX驱动.rar...
aas7502987 2011-05-24 22:48
STM32F103RBT6最小系统原理图 PCB
STM32F103RBT6最小系统板原理图 PCB 附件:做好的成品板:淘宝链接网址:http://item.taobao.com/item.htm?id=8864376956...
aas7502987 2011-05-08 12:53
YL-16 STM32F103最小系统板资料(更新中)
二 数据手册:  USB协议中文版:attachment download  中文数据手册:attachment downloadSTM32选型手册:attachment downloadSTM32勘...
aas7502987 2011-03-20 13:27
DS18B20温度测量模块
DS18B20 数码管温度显示程序:...
我要评论
0
1
广告