找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 5732|回復(fù): 8
收起左側(cè)

STM32_BMP280資料+源代碼

  [復(fù)制鏈接]
ID:235638 發(fā)表于 2019-4-12 15:33 | 顯示全部樓層 |閱讀模式
STM32_BMP280
0.png
單片機(jī)源程序如下:
  1. #include "sys.h"
  2. #include "delay.h"
  3. #include "usart.h"
  4. #include "led.h"
  5. #include "myiic.h"
  6. #include "bme280.h"

  7. int main(void)
  8. {
  9.         float bmp280_temp;
  10.         float bmp280_press;
  11.         float bmp280_humi;
  12.         float high;
  13.         NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);                            //設(shè)置中斷優(yōu)先級(jí)分組2
  14.         uart_init(9600);                                                           //初始化USART
  15.         LED_Init();                                                                //初始化LED
  16.     IIC_Init();       
  17.         delay_init();
  18.         bme280Init();
  19.     while(1)
  20.     {
  21.         bme280GetData(&bmp280_press,&bmp280_temp,&bmp280_humi,&high);
  22.                 delay_ms(1500);
  23.                 LED0=!LED0;
  24.                 printf("bmp280_press:%f\r\n",bmp280_press);
  25.                 delay_ms(100);
  26.                 printf("bmp280_temp :%f\r\n",bmp280_temp);
  27.                 delay_ms(100);
  28.                 printf("bmp280_humidity :%f\r\n",bmp280_humi);
  29.                 delay_ms(100);
  30.                 printf("bmp280_high :%f\r\n\r\n",high);
  31.         }
  32. }
復(fù)制代碼

所有資料51hei提供下載:
BME280_STM32.zip (2.88 MB, 下載次數(shù): 488)


評(píng)分

參與人數(shù) 1黑幣 +50 收起 理由
admin + 50 共享資料的黑幣獎(jiǎng)勵(lì)!

查看全部評(píng)分

回復(fù)

使用道具 舉報(bào)

ID:426741 發(fā)表于 2019-4-22 23:09 | 顯示全部樓層
此帖僅作者可見

使用道具 舉報(bào)

ID:622055 發(fā)表于 2019-11-4 01:16 | 顯示全部樓層
此帖僅作者可見

使用道具 舉報(bào)

ID:512676 發(fā)表于 2019-12-1 16:30 | 顯示全部樓層
此帖僅作者可見

使用道具 舉報(bào)

ID:512676 發(fā)表于 2019-12-1 16:31 | 顯示全部樓層
此帖僅作者可見

使用道具 舉報(bào)

ID:316641 發(fā)表于 2019-12-2 11:22 | 顯示全部樓層
此帖僅作者可見

使用道具 舉報(bào)

ID:658039 發(fā)表于 2020-1-8 22:15 | 顯示全部樓層
此帖僅作者可見

使用道具 舉報(bào)

ID:422924 發(fā)表于 2021-5-19 03:54 | 顯示全部樓層
此帖僅作者可見

使用道具 舉報(bào)

ID:337280 發(fā)表于 2022-12-15 14:35 | 顯示全部樓層
此帖僅作者可見

使用道具 舉報(bào)

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規(guī)則

手機(jī)版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機(jī)教程網(wǎng)

快速回復(fù) 返回頂部 返回列表