生活随笔
收集整理的這篇文章主要介紹了
基于单片机智能鱼缸系统仿真设计-资料
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
百度網(wǎng)盤下載地址(1131):點(diǎn)擊下載
說明:
1.能夠分別檢測(cè)魚缸和室內(nèi)溫度并顯示2.能夠?qū)崿F(xiàn)魚缸溫度自動(dòng)調(diào)節(jié)(升溫降溫恒溫)3.系統(tǒng)能夠?qū)崿F(xiàn)
依據(jù)被投食設(shè)定相應(yīng)的定時(shí)時(shí)間。4.系統(tǒng)可以實(shí)現(xiàn)自動(dòng)和手動(dòng)模式功能。注:仿真中調(diào)節(jié)溫度是有抖動(dòng),
正常現(xiàn)象。
#include <REGX51.H>
#include "1602.H"
#include "DS18B20.h"
extern void DelayMs( unsigned char t );unsigned int Temp[5]; /* 溫度值溫度放大10倍 */
int DS18B20DATA[3]; /* DS18B20讀到的16位數(shù)據(jù) */
code unsigned char DecimalNum[16] = { 0, 1, 1, 2, 3, 3, 4, 4, 5, 6, 6, 7, 8, 8, 9, 9 }; /* DS18B20小數(shù)部分對(duì)應(yīng)的數(shù) */
unsigned char code DuanMa[] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f };
sbit LED = P3 ^ 1; /* LED報(bào)警 */sbit LE = P3 ^ 0;
sbit Key = P2 ^ 6;sbit SET = P1 ^ 7; /* 設(shè)置鍵 */
sbit ADD = P3 ^ 3; /* 加++1 */
sbit DEC = P3 ^ 4; /* 減--1 */sbit UP = P2 ^ 3;
sbit DOWN = P2 ^ 4;
sbit LED1 = P1 ^ 0;
sbit LED2 = P1 ^ 1;
sbit LED3 = P1 ^ 2;sbit GAO = P3^6;
sbit DI = P3^7;
sbit CHU = P1^3;
sbit JIN = P1^4;
sbit WEI = P1^5;unsigned char flag = 1;
unsigned char CurID; /* 路數(shù)ID */
unsigned int s = 430; /* 溫度上限 放大十倍 */
unsigned int t = 310; /* 溫度下限 放大十倍 */
unsigned int a = 1200; /* 溫度上限 放大十倍 */
unsigned int num = 0; /* 50ms */
unsigned int time = 0;/* 顯示段碼值01234567 */
unsigned char LCDbuf[16];bit display = 0;
bit timeFlag = 0;/* DS18B20溫度讀取 */
void DS18B20Read()
{gettemp( DS18B20DATA );Temp[2] = (DS18B20DATA[0] >> 4) * 10 + DecimalNum[DS18B20DATA[0] & 0x0f];
總結(jié)
以上是生活随笔為你收集整理的基于单片机智能鱼缸系统仿真设计-资料的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。