嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 2 元微信扫码支付:2 元
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
DS18B20温度采集
#include "delay.h"
#include "sys.h"
#include <stm32f10x.h>
#include "oled.h"
#include "bmp.h"
#include "usart.h"
#include "ds18b20.h"
#include "key.h"
#include "led.h"
int main(void)
{
double temperature;
u8 key;
static u8 predict=20;
delay_init(); //延时函数初始化
NVIC_Configuration(); //设置NVIC中断分组2:2位抢占优先级,2位响应优先级
DS18B20_Init();
uart_init(115200); //串口初始化为115200
OLED_Init(); //初始化OLED
OLED_Clear();
KEY_Init();
Init_LEDpin();
// Init_LEDpin() ;
delay_ms(1000);
while(1)
{
OLED_ShowCHinese(0,0,0); //领
OLED_ShowCHinese(15,0,1);//卓
OLED_ShowCHinese(31,0,2);//
OLED_ShowCHinese(47,0,3);//
OLED_ShowCHinese(63,0,4);//研
OLED_ShowCHinese(79,0,5);//发
OLED_ShowCHinese(95,0,6);//中
OLED_ShowCHinese(111,0,7);//心
OLED_ShowCHinese(0,3,8);//
OLED_ShowCHinese(15,3,9 );//
OLED_ShowCHinese(31,3,10);//
OLED_ShowCHinese(47,3,11);//
OLED_ShowCHinese(62,3,16);//
OLED_ShowCHinese(0,6,12);//
OLED_ShowCHinese(15,6,13 );//
OLED_ShowCHinese(31,6,14);//
OLED_ShowCHinese(47,6,15);//
OLED_ShowCHinese(62,6,16);//
temperature=DS18B20_Get_Temp();
printf("温度值:%2.2f°C\r\n\r\n",temperature);
OLED_ShowNum(78,3,temperature,2,16);//显示ASCII字符的码值
OLED_ShowNum(78,6,predict,2,16);//显示ASCII字符的码值
key=KEY_Scan(0);
switch(key)
{
case KEY_K1_PRESS : predict ; break;
case KEY_K2_PRESS : --predict ; break;
}
if(predict==100)
predict=0;
if(temperature<predict-1)
{
GPIO_ResetBits(GPIOA,GPIO_Pin_4);
GPIO_SetBits (GPIOA,GPIO_Pin_2);
}
else if(temperature > predict 1)
{
GPIO_ResetBits(GPIOA,GPIO_Pin_2);
GPIO_SetBits (GPIOA,GPIO_Pin_4);
}
else
{
GPIO_SetBits (GPIOA,GPIO_Pin_2);
GPIO_SetBits (GPIOA,GPIO_Pin_4);
}
}
}
.
├── 18-DS18B20温度采集
│ ├── CORE
│ │ ├── core_cm3.c
│ │ ├── core_cm3.h
│ │ ├── startup_stm32f10x_hd.s
│ │ └── startup_stm32f10x_md.s
│ ├── DS18B20原理图.JPG
│ ├── HARDWARE
│ │ ├── inc
│ │ │ ├── LED.c
│ │ │ ├── adc.h
│ │ │ ├── bmp.h
│ │ │ ├── delay.h
│ │ │ ├── dma.h
│ │ │ ├── ds18b20.h
│ │ │ ├── exti.h
│ │ │ ├── key.c
│ │ │ ├── key.h
│ │ │ ├── led.h
│ │ │ ├── oled.h
│ │ │ ├── oled_font.h
│ │ │ ├── oledfont.h
│ │ │ ├── oledfont.hPreview
│ │ │ ├── pwm.h
│ │ │ ├── remote.h
│ │ │ ├── rtc.h
│ │ │ ├── sys.h
│ │ │ ├── timer.h
│ │ │ ├── usart.h
│ │ │ ├── usart2.h
│ │ │ └── wdg.h
│ │ └── scr
│ │ ├── LED.h
│ │ ├── adc.c
│ │ ├── delay.c
│ │ ├── dma.c
│ │ ├── ds18b20.c
│ │ ├── exti.c
│ │ ├── key.c
│ │ ├── key.h
│ │ ├── led.c
│ │ ├── oled.c
│ │ ├── pwm.c
│ │ ├── remote.c
│ │ ├── rtc.c
│ │ ├── sys.c
│ │ ├── timer.c
│ │ ├── usart.c
│ │ ├── usart2.c
│ │ └── wdg.c
│ ├── OBJ
│ │ ├── DS18B20温度采集.axf
│ │ ├── DS18B20温度采集.build_log.htm
│ │ ├── DS18B20温度采集.hex
│ │ ├── DS18B20温度采集.htm
│ │ ├── DS18B20温度采集.lnp
│ │ ├── DS18B20温度采集.sct
│ │ ├── ExtDll.iex
│ │ ├── LED_DS18B20温度采集.dep
│ │ ├── core_cm3.crf
│ │ ├── core_cm3.d
│ │ ├── core_cm3.o
│ │ ├── delay.crf
│ │ ├── delay.d
│ │ ├── delay.o
│ │ ├── ds18b20.crf
│ │ ├── ds18b20.d
│ │ ├── ds18b20.o
│ │ ├── key.crf
│ │ ├── key.d
│ │ ├── key.o
│ │ ├── led.crf
│ │ ├── led.d
│ │ ├── led.o
│ │ ├── main.crf
│ │ ├── main.d
│ │ ├── main.o
│ │ ├── misc.crf
│ │ ├── misc.d
│ │ ├── misc.o
│ │ ├── oled.crf
│ │ ├── oled.d
│ │ ├── oled.o
│ │ ├── startup_stm32f10x_hd.d
│ │ ├── startup_stm32f10x_hd.o
│ │ ├── stm32f10x_gpio.crf
│ │ ├── stm32f10x_gpio.d
│ │ ├── stm32f10x_gpio.o
│ │ ├── stm32f10x_it.crf
│ │ ├── stm32f10x_it.d
│ │ ├── stm32f10x_it.o
│ │ ├── stm32f10x_rcc.crf
│ │ ├── stm32f10x_rcc.d
│ │ ├── stm32f10x_rcc.o
│ │ ├── stm32f10x_tim.crf
│ │ ├── stm32f10x_tim.d
│ │ ├── stm32f10x_tim.o
│ │ ├── stm32f10x_usart.crf
│ │ ├── stm32f10x_usart.d
│ │ ├── stm32f10x_usart.o
│ │ ├── sys.crf
│ │ ├── sys.d
│ │ ├── sys.o
│ │ ├── system_stm32f10x.crf
│ │ ├── system_stm32f10x.d
│ │ ├── system_stm32f10x.o
│ │ ├── usart.crf
│ │ ├── usart.d
│ │ └── usart.o
│ ├── STM32F10x_FWLib
│ │ ├── inc
│ │ │ ├── misc.h
│ │ │ ├── stm32f10x_adc.h
│ │ │ ├── stm32f10x_bkp.h
│ │ │ ├── stm32f10x_can.h
│ │ │ ├── stm32f10x_cec.h
│ │ │ ├── stm32f10x_crc.h
│ │ │ ├── stm32f10x_dac.h
│ │ │ ├── stm32f10x_dbgmcu.h
│ │ │ ├── stm32f10x_dma.h
│ │ │ ├── stm32f10x_exti.h
│ │ │ ├── stm32f10x_flash.h
│ │ │ ├── stm32f10x_fsmc.h
│ │ │ ├── stm32f10x_gpio.h
│ │ │ ├── stm32f10x_i2c.h
│ │ │ ├── stm32f10x_iwdg.h
│ │ │ ├── stm32f10x_pwr.h
│ │ │ ├── stm32f10x_rcc.h
│ │ │ ├── stm32f10x_rtc.h
│ │ │ ├── stm32f10x_sdio.h
│ │ │ ├── stm32f10x_spi.h
│ │ │ ├── stm32f10x_tim.h
│ │ │ ├── stm32f10x_usart.h
│ │ │ └── stm32f10x_wwdg.h
│ │ └── src
│ │ ├── misc.c
│ │ ├── stm32f10x_adc.c
│ │ ├── stm32f10x_bkp.c
│ │ ├── stm32f10x_can.c
│ │ ├── stm32f10x_cec.c
│ │ ├── stm32f10x_crc.c
│ │ ├── stm32f10x_dac.c
│ │ ├── stm32f10x_dbgmcu.c
│ │ ├── stm32f10x_dma.c
│ │ ├── stm32f10x_exti.c
│ │ ├── stm32f10x_flash.c
│ │ ├── stm32f10x_fsmc.c
│ │ ├── stm32f10x_gpio.c
│ │ ├── stm32f10x_i2c.c
│ │ ├── stm32f10x_iwdg.c
│ │ ├── stm32f10x_pwr.c
│ │ ├── stm32f10x_rcc.c
│ │ ├── stm32f10x_rtc.c
│ │ ├── stm32f10x_sdio.c
│ │ ├── stm32f10x_spi.c
│ │ ├── stm32f10x_tim.c
│ │ ├── stm32f10x_usart.c
│ │ └── stm32f10x_wwdg.c
│ ├── USER
│ │ ├── DS18B20温度采集.map
│ │ ├── JLinkLog.txt
│ │ ├── JLinkSettings.ini
│ │ ├── LED.Uv2.bak
│ │ ├── LED.opt.bak
│ │ ├── LED.uvgui.Administrator
│ │ ├── LED.uvgui_Administrator.bak
│ │ ├── LED.uvopt
│ │ ├── LED.uvproj
│ │ ├── LED_DS18B20温度采集.dep
│ │ ├── LED_uvopt.bak
│ │ ├── LED_uvproj.bak
│ │ ├── main.c
│ │ ├── startup_stm32f10x_hd.lst
│ │ ├── stm32f10x.h
│ │ ├── stm32f10x_conf.h
│ │ ├── stm32f10x_it.c
│ │ ├── stm32f10x_it.h
│ │ ├── system_stm32f10x.c
│ │ └── system_stm32f10x.h
│ └── 说明.txt
└── 好例子网_18-DS18B20温度采集.rar
10 directories, 171 files