OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 3980|回复: 0

自己编程编译通过但是没法实现功能,监测温度用的DS18B20,监测温度的开发板是mini,接收温度用的战舰,麻烦大佬看下问题在哪里

[复制链接]

1

主题

1

帖子

0

精华

新手入门

积分
13
金钱
13
注册时间
2020-4-27
在线时间
2 小时
发表于 2020-4-27 22:10:25 | 显示全部楼层 |阅读模式
1金钱
mini板   用DS18B20监测温度,通过LORA模块传输给接收板
#include "sys.h"
#include "usart.h"  
#include "delay.h"
#include "led.h"   
#include "lcd.h"   
#include "key.h"
#include "usmart.h"
#include "malloc.h"  
#include "MMC_SD.h"
#include "ff.h"  
#include "exfuns.h"
#include "fontupd.h"
#include "text.h"
#include "touch.h"
#include "flash.h"
#include "lora_app.h"

               
u16 temp;              
int main(void)
{   

  Stm32_Clock_Init(9);         
delay_init(72);           
uart_init(72,115200);         

LED_Init();                 
KEY_Init();            
DS18B20_Init();
  while(LoRa_Init())
{
  delay_ms(300);
}
LoRa_Set();
while(1)
{
  temp=DS18B20_Get_Temp();
   LoRa_SendData();

  delay_ms(500);
}

}



战舰版  用于接收显示温度
#include "sys.h"
#include "delay.h"
#include "usart.h"
#include "led.h"      
#include "lcd.h"  
#include "key.h"     
#include "usmart.h"
#include "sram.h"
#include "malloc.h"
#include "sdio_sdcard.h"  
#include "w25qxx.h"   
#include "ff.h"  
#include "exfuns.h"   
#include "text.h"
#include "touch.h"  
#include "usart3.h"
#include "lora_app.h"
#include "ds18b20.h"
  u16 temp;              
int main(void)
{   

  Stm32_Clock_Init(9);         
delay_init(72);           
uart_init(72,115200);            

LED_Init();                  
KEY_Init();            
DS18B20_Init();
  while(LoRa_Init())
{
  
  delay_ms(300);
  
}
LCD_Init();

POINT_COLOR=BLUE;
LCD_ShowString(30,130,200,16,16,"TEMP:");
LoRa_Set();
while(1)
{

  LoRa_ReceData();
  LCD_ShowxNum(126,130,USART3_RX_BUF[5],4,16,0);

}

}
麻烦大佬看下问题出在哪里


正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

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

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2024-6-7 20:52

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

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