找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 3756|回复: 2
打印 上一主题 下一主题
收起左侧

单片机液滴(点滴)测速系统Protues仿真与源代码 带液面检测功能

[复制链接]
跳转到指定楼层
楼主
液滴测速的源程序和仿真分享给大家
点滴测量系统
带液面检测  按键按下为液面抵达最低位置


单片机源程序如下:
  1. /***************   writer:shopping.w   ******************/
  2. #include <reg52.h>
  3. #include <string.h>
  4. #include "time.h"

  5. #include "lcd1602.h"
  6. #include "INT.h"

  7. #define uchar unsigned char
  8. #define uint unsigned int


  9. sbit SPK= P2^4;


  10. sbit IN0=P3^2;

  11. void Delayxms(uint ms)
  12. {
  13.          uchar i;
  14.         while(ms--)
  15.         {
  16.                  for(i=0;i<120;i++);
  17.         }
  18. }


  19. void main()
  20. {
  21.         Initialize_LCD();
  22.         ShowString(0,0,"Speed:    d/min ");
  23.         ShowString(0,1,"State:          ");
  24.         Delayxms(500);
  25.         Int0_Init();                 //外部中断初始化
  26.         Time0_Init();                 //定时器初始化
  27.         while(1)
  28.         {
  29.                 if(IN0==0)  //达到最低液面
  30.                 {        
  31.                         SPK=0;
  32.                         Delayxms(300);
  33.                         SPK=1;
  34.                         Delayxms(300);
  35.                         ShowString(7,1,"Abnormal ");
  36.                
  37.                 }
  38.                 else
  39.                 {
  40.                         
  41.                         ShowString(7,1,"Normal   ");
  42.                 }
  43.                         
  44.                
  45.                 Write_LCD_Command(0x80+6);                 //第一行0x8开头
  46.                 Write_LCD_Data(dd/1000+0x30);
  47.                 Write_LCD_Data(dd/100+0x30);
  48.                 Write_LCD_Data(dd%100/10+0x30);
  49.                 Write_LCD_Data(dd%100%10+0x30);
  50. /*               
  51.                 Write_LCD_Command(0xc0+6);                 //第二行0xc0开头
  52.                 Write_LCD_Data(count/1000+0x30);
  53.                 Write_LCD_Data(count%1000/100+0x30);
  54.                 Write_LCD_Data(count%1000%100/10+0x30);
  55.                 Write_LCD_Data(count%1000%100%10+0x30);
  56. */               
  57.                 if(dd>60)
  58.                 {
  59. ……………………

  60. …………限于本文篇幅 余下代码请从51黑下载附件…………
复制代码

所有资料51hei提供下载:
5-Protues仿真.rar (45.35 KB, 下载次数: 147)




分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏3 分享淘帖 顶 踩1
回复

使用道具 举报

沙发
ID:727509 发表于 2020-4-12 20:35 | 只看该作者
仿真图用Proteus7.5打开是这样的:

回复

使用道具 举报

板凳
ID:247623 发表于 2021-2-22 22:53 | 只看该作者
wmn19980821 发表于 2020-4-12 20:35
仿真图和页面的不一样

你好,你的proteus是什么版本的能打开,我用的7.8和8.6的都打不开
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表