標(biāo)題: 自己寫的STM32開發(fā)板MLX90614紅外測溫系統(tǒng)參考代碼 [打印本頁]

作者: 1922323908    時(shí)間: 2020-12-5 12:49
標(biāo)題: 自己寫的STM32開發(fā)板MLX90614紅外測溫系統(tǒng)參考代碼
  由于代碼過多這里就不展示分析了,想了解的可以看壓縮包

單片機(jī)源程序如下:
  1. #include "stm32f10x.h"
  2. #include "./flash/bsp_spi_flash.h"
  3. #include "./lcd/bsp_ili9341_lcd.h"
  4. #include "./fonts/font.h"        
  5. #include "stdio.h"
  6. #include "math.h"
  7. #include "./MLX90614/mlx90614.h"


  8. uint16_t i=0;
  9. float  temperature=0;


  10. void Delay(uint32_t timp)
  11. {


  12.       for(;timp!=0;timp--);


  13. }


  14. void LCD_text(void)
  15. {        

  16.          char dispBuff[240];
  17.                LCD_SetFont(&Font8x16);
  18.                LCD_SetColors(RED,BLACK);                        
  19.                temperature=(float)SMBus_ReadTemp();                                                                                                                 
  20.                sprintf(dispBuff,"溫度值: %f C",temperature);
  21.                      LCD_ClearLine(LINE(0));
  22.                ILI9341_DispStringLine_EN_CH(LINE(0),dispBuff);

  23. }




  24. int main(void)
  25. {
  26.         

  27.         SMBus_Init();
  28.   ILI9341_Init ();
  29.   while (1)
  30.   {   
  31.        ILI9341_Clear ( 0, 16, 240,305);         
  32.                    LCD_text();
  33.    
  34.                      
  35.    
  36.   }
  37. }
復(fù)制代碼

所有資料51hei提供下載:
紅外.7z (227.02 KB, 下載次數(shù): 51)







歡迎光臨 (http://www.torrancerestoration.com/bbs/) Powered by Discuz! X3.1