• 大小: 1.74MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-09-15
  • 语言: 其他
  • 标签: STM32F407  BMP180  I2C  

资源简介

利用STM32F407的I2C1(PB8、PB9),采集BMP180的温度、压力原始数据和校正后的数据,并计算出当前的海拔高度,在液晶屏上进行显示

资源截图

代码片段和文件信息



#include “stm32f407Tek_COM2.h“
#include “stm32f407Tek_LED.h“
#include “stm32f407Tek_Systick.h“
#include “stm32f407Tek_TFT_LCD.h“
#include “Stm32f407Tek_BMP180.h“
#include 

extern uint16_t unPointColor;

int main(void)
{
uint8_t ucID=0k=0;
long nOrigin_UT=0nOrigin_UP=0;
long nReal_UT=0nReal_UP=0;
float fAltitude=0;

STM32F407Tek_Systick_Init();
STM32F407Tek_LED_Init();
STM32F407Tek_COM2_Init();
STM32F407Tek_TFT_LCD_Init();
STM32F407Tek_BMP180_Init();

STM32F407Tek_BMP180_ReadCalibrationData();

unPointColor=RED;
LCD_ShowString(30503001624“STM32F407Tek Explorer“);
LCD_ShowString(30802001624“BMP180 Test...“);
LCD_ShowString(301102001624“kdykong@126.com“);
LCD_ShowString(301402001624“2015-08-18“);

LCD_ShowString(301702001624“BMP180_ID:    “);
LCD_ShowString(302002001624“Origin_UT:    “);
LCD_ShowString(302302001624“Origin_UP:    “);
LCD_ShowString(302602001624“Real Temp:    “);
LCD_ShowString(302902001624“Real Pres:    “);
LCD_ShowString(303202001624“Altitude :    “);
ucID=STM32F407Tek_BMP180_ReadBMP180_ID();
LCD_ShowNum(30+11*12170ucID324);

while(1)
{
if(k%10==0)
{
nOrigin_UT=STM32F407Tek_BMP180_ReadUncompensatedTemperature();
LCD_ShowNum(30+11*12200nOrigin_UT524);
nOrigin_UP=STM32F407Tek_BMP180_ReadUncompensatedPress();
LCD_ShowNum(30+11*12230nOrigin_UP524);
STM32F407Tek_BMP180_CalculateCompensatedData(nOrigin_UTnOrigin_UP&nReal_UT&nReal_UP&fAltitude);
LCD_ShowNum(30+11*12260nReal_UT/10324);
LCD_ShowString(30+14*12260251624“.“);
LCD_ShowNum(30+15*12260nReal_UT%10124);
LCD_ShowString(30+17*12260251624“C“);

LCD_ShowNum(30+11*12290nReal_UP624);
LCD_ShowString(30+17*12290251624“Pa“);

LCD_ShowNum(30+11*12320(int)fAltitude524);
LCD_ShowString(30+16*12320251624“.“);
LCD_ShowNum(30+17*12320(fAltitude-(int)fAltitude)*10124);

}

Delay_ms_Time(10);
k++;
if(k==20)
{
k=0;
STM32F407Tek_LED_Toggle(1);
}
}
}


 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      35016  2014-01-02 17:22  STM32F407Tek_BMP180-kdy20150818\FONT.H

     文件      75083  2015-08-19 10:09  STM32F407Tek_BMP180-kdy20150818\Listings\startup_stm32f40_41xxx.lst

     文件     206873  2015-08-19 10:09  STM32F407Tek_BMP180-kdy20150818\Listings\STM32F407Tek_BMP180-kdy20150818.map

     文件         19  2015-08-19 10:04  STM32F407Tek_BMP180-kdy20150818\objects\ExtDll.iex

     文件         62  2015-08-19 10:09  STM32F407Tek_BMP180-kdy20150818\objects\startup_stm32f40_41xxx.d

     文件       8020  2015-08-19 10:09  STM32F407Tek_BMP180-kdy20150818\objects\startup_stm32f40_41xxx.o

     文件     469876  2015-08-19 10:09  STM32F407Tek_BMP180-kdy20150818\objects\STM32F407Tek_BMP180-kdy20150818.axf

     文件       1806  2015-08-19 10:09  STM32F407Tek_BMP180-kdy20150818\objects\STM32F407Tek_BMP180-kdy20150818.build_log.htm

     文件      16918  2015-08-19 10:09  STM32F407Tek_BMP180-kdy20150818\objects\stm32f407tek_bmp180-kdy20150818.crf

     文件        598  2015-08-19 10:09  STM32F407Tek_BMP180-kdy20150818\objects\stm32f407tek_bmp180-kdy20150818.d

     文件     124946  2015-08-19 10:09  STM32F407Tek_BMP180-kdy20150818\objects\STM32F407Tek_BMP180-kdy20150818.htm

     文件        788  2015-08-19 10:09  STM32F407Tek_BMP180-kdy20150818\objects\STM32F407Tek_BMP180-kdy20150818.lnp

     文件      22240  2015-08-19 10:09  STM32F407Tek_BMP180-kdy20150818\objects\stm32f407tek_bmp180-kdy20150818.o

     文件        479  2015-08-18 12:31  STM32F407Tek_BMP180-kdy20150818\objects\STM32F407Tek_BMP180-kdy20150818.sct

     文件      11923  2015-08-19 10:09  STM32F407Tek_BMP180-kdy20150818\objects\STM32F407Tek_BMP180-kdy20150818_BMP180.dep

     文件     309928  2015-08-19 10:09  STM32F407Tek_BMP180-kdy20150818\objects\stm32f407tek_bmp180.crf

     文件        937  2015-08-19 10:09  STM32F407Tek_BMP180-kdy20150818\objects\stm32f407tek_bmp180.d

     文件     340772  2015-08-19 10:09  STM32F407Tek_BMP180-kdy20150818\objects\stm32f407tek_bmp180.o

     文件     301560  2015-08-19 10:09  STM32F407Tek_BMP180-kdy20150818\objects\stm32f407tek_com2.crf

     文件        876  2015-08-19 10:09  STM32F407Tek_BMP180-kdy20150818\objects\stm32f407tek_com2.d

     文件     324956  2015-08-19 10:09  STM32F407Tek_BMP180-kdy20150818\objects\stm32f407tek_com2.o

     文件     289799  2015-08-19 10:09  STM32F407Tek_BMP180-kdy20150818\objects\stm32f407tek_led.crf

     文件        660  2015-08-19 10:09  STM32F407Tek_BMP180-kdy20150818\objects\stm32f407tek_led.d

     文件     313404  2015-08-19 10:09  STM32F407Tek_BMP180-kdy20150818\objects\stm32f407tek_led.o

     文件     312510  2015-08-19 10:09  STM32F407Tek_BMP180-kdy20150818\objects\stm32f407tek_systick.crf

     文件        920  2015-08-19 10:09  STM32F407Tek_BMP180-kdy20150818\objects\stm32f407tek_systick.d

     文件     338840  2015-08-19 10:09  STM32F407Tek_BMP180-kdy20150818\objects\stm32f407tek_systick.o

     文件     325640  2015-08-19 10:09  STM32F407Tek_BMP180-kdy20150818\objects\stm32f407tek_tft_lcd.crf

     文件        919  2015-08-19 10:09  STM32F407Tek_BMP180-kdy20150818\objects\stm32f407tek_tft_lcd.d

     文件     418052  2015-08-19 10:09  STM32F407Tek_BMP180-kdy20150818\objects\stm32f407tek_tft_lcd.o

............此处省略60个文件信息

评论

共有 条评论