资源简介
利用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\ob
文件 62 2015-08-19 10:09 STM32F407Tek_BMP180-kdy20150818\ob
文件 8020 2015-08-19 10:09 STM32F407Tek_BMP180-kdy20150818\ob
文件 469876 2015-08-19 10:09 STM32F407Tek_BMP180-kdy20150818\ob
文件 1806 2015-08-19 10:09 STM32F407Tek_BMP180-kdy20150818\ob
文件 16918 2015-08-19 10:09 STM32F407Tek_BMP180-kdy20150818\ob
文件 598 2015-08-19 10:09 STM32F407Tek_BMP180-kdy20150818\ob
文件 124946 2015-08-19 10:09 STM32F407Tek_BMP180-kdy20150818\ob
文件 788 2015-08-19 10:09 STM32F407Tek_BMP180-kdy20150818\ob
文件 22240 2015-08-19 10:09 STM32F407Tek_BMP180-kdy20150818\ob
文件 479 2015-08-18 12:31 STM32F407Tek_BMP180-kdy20150818\ob
文件 11923 2015-08-19 10:09 STM32F407Tek_BMP180-kdy20150818\ob
文件 309928 2015-08-19 10:09 STM32F407Tek_BMP180-kdy20150818\ob
文件 937 2015-08-19 10:09 STM32F407Tek_BMP180-kdy20150818\ob
文件 340772 2015-08-19 10:09 STM32F407Tek_BMP180-kdy20150818\ob
文件 301560 2015-08-19 10:09 STM32F407Tek_BMP180-kdy20150818\ob
文件 876 2015-08-19 10:09 STM32F407Tek_BMP180-kdy20150818\ob
文件 324956 2015-08-19 10:09 STM32F407Tek_BMP180-kdy20150818\ob
文件 289799 2015-08-19 10:09 STM32F407Tek_BMP180-kdy20150818\ob
文件 660 2015-08-19 10:09 STM32F407Tek_BMP180-kdy20150818\ob
文件 313404 2015-08-19 10:09 STM32F407Tek_BMP180-kdy20150818\ob
文件 312510 2015-08-19 10:09 STM32F407Tek_BMP180-kdy20150818\ob
文件 920 2015-08-19 10:09 STM32F407Tek_BMP180-kdy20150818\ob
文件 338840 2015-08-19 10:09 STM32F407Tek_BMP180-kdy20150818\ob
文件 325640 2015-08-19 10:09 STM32F407Tek_BMP180-kdy20150818\ob
文件 919 2015-08-19 10:09 STM32F407Tek_BMP180-kdy20150818\ob
文件 418052 2015-08-19 10:09 STM32F407Tek_BMP180-kdy20150818\ob
............此处省略60个文件信息
相关资源
- 通过STM32F407对BH1750光照度传感器采集
- STM32F103C8T6每隔20s驱动DS18B20测温_OLED
- STM32F407VE实现软件IIC读取mpu6050数据
- stm32f407官方评估板,包含原理图和P
- stm32f407舵机控制程序
- STM32F蓝牙超声波避障小车
- KS103 stm32f407程序
- 基于stm32f407的贪吃蛇
- STM32F407引脚说明
- F1模拟iic驱动oled
- 蓝牙控制8个舵机STM32F407+pca9685+HC06
- STM32F407+ov2640图像处理图像经过二值化
- MPU9250九轴官方MPL库移植STM32F407例程
- stm32f407+dm9161驱动程序
- 正点原子stm32f407探索者LD3320语音识别
- BMP180数据手册
- 基于stm32F407的音乐播放器
- STM32硬件I2C读写AT24Cxx
- 基于 STM32 的 I2C 时序 - 模拟 I2C
- STM32F407系统时钟设置程序STM32F4xx_Clo
- 基于STM32F407开发板驱动触摸屏原子
- STM32F407四路12位AD采样
- i2c slave端verilog代码
- FreeModbus--RTU--Master+Slave--uCOSIII--STM32F
- 旋钮编码器STM32F407
- 通过串口控制呼吸灯的频率
- STM32F407 USB 自定义HID实现代码
- STM32BMP180程序
- STM32F407 DMA+串口接收不定长数据程序
- 实验9X stm32F407zgt6_PWM控制SG90输出实验
评论
共有 条评论