新手入门
- 积分
- 13
- 金钱
- 13
- 注册时间
- 2020-4-27
- 在线时间
- 2 小时
|
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);
}
}
麻烦大佬看下问题出在哪里
|
|