91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 1.67MB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2023-08-30
  • 語言: 其他
  • 標簽:

資源簡介

氣壓傳感器lcd1602顯示

資源截圖

代碼片段和文件信息

/*
????BMP085?Test?Code
April?7?2010
by:?Jim?Lindblom

Test?code?for?the?BMP085?Barometric?Pressure?Sensor.
We‘ll?first?read?all?the?calibration?values?from?the?sensor.
Then?the?pressure?and?temperature?readings?will?be?read?and?calculated.
Also?attempts?to?calculate?altitude?(remove?comments)
The?sensor?is?run?in?ultra?low?power?mode.
Tested?on?a?3.3V?8MHz?Arduino?Pro
A4?(PC4)?->?SDA
A5?(PC5)?->?SCL
No?Connection?to?EOC?or?XCLR?pins
*/

#include?
#include?
#include?
#include?
#include?
#include?“types.h“
#include?“defs.h“
//#include?“math.h“ //?To?calculate?altitude
#include?“i2c.h“

#define?FOSC?8000000
#define?BAUD?9600
#define?BMP085_R?0xEF
#define?BMP085_W?0xEE
#define?OSS?0 //?Oversampling?Setting?(note:?code?is?not?set?up?to?use?other?OSS?values)

#define?sbi(var?mask)???((var)?|=?(uint8_t)(1?<#define?cbi(var?mask)???((var)?&=?(uint8_t)~(1?<
///============Function?Prototypes=========/////////////////
void?BMP085_Calibration(void);

///============I2C?Prototypes=============//////////////////
short?bmp085ReadShort(unsigned?char?address);
long?bmp085ReadTemp(void);
long?bmp085ReadPressure(void);
void?bmp085Convert(long?*?temperature?long?*?pressure);

///============Initialize?Prototypes=====//////////////////
void?ioinit(void);
void?UART_Init(unsigned?int?ubrr);
static?int?uart_putchar(char?c?FILE?*stream);
void?put_char(unsigned?char?byte);
static?FILE?mystdout?=?FDEV_SETUP_STREAM(uart_putchar?NULL?_FDEV_SETUP_WRITE);
void?delay_ms(uint16_t?x);

/////=========Global?Variables======////////////////////
short?ac1;
short?ac2;?
short?ac3;?
unsigned?short?ac4;
unsigned?short?ac5;
unsigned?short?ac6;
short?b1;?
short?b2;
short?mb;
short?mc;
short?md;

int?main(void)
{
long?temperature?=?0;
long?pressure?=?0;
//long?altitude?=?0;
//double?temp?=?0;

ioinit();
i2cInit();
delay_ms(100);

BMP085_Calibration();

while(1)
{
bmp085Convert(&temperature?&pressure);

printf(“Temperature:?%ld?(in?0.1?deg?C)\n“?temperature);
printf(“Pressure:?%ld?Pa\n\n“?pressure);

//?For?fun?lets?convert?to?altitude
/*temp?=?(double)?pressure/101325;
temp?=?1-pow(temp?0.19029);
altitude?=?round(44330*temp);
printf(“Altitude:?%ldm\n\n“?altitude);*/

delay_ms(1000);
}
}

void?BMP085_Calibration(void)
{
printf(“\nCalibration?Information:\n“);
printf(“------------------------\n“);
ac1?=?bmp085ReadShort(0xAA);
ac2?=?bmp085ReadShort(0xAC);
ac3?=?bmp085ReadShort(0xAE);
ac4?=?bmp085ReadShort(0xB0);
ac5?=?bmp085ReadShort(0xB2);
ac6?=?bmp085ReadShort(0xB4);
b1?=?bmp085ReadShort(0xB6);
b2?=?bmp085ReadShort(0xB8);
mb?=?bmp085ReadShort(0xBA);
mc?=?bmp085ReadShort(0xBC);
md?=?bmp085ReadShort(0xBE);

printf(“\tAC1?=?%d\n“?ac1);
printf(“\tAC2?=?%d\n“?ac2);
printf(“\tAC3?=?%d\n“?ac3);
printf(“\tAC4?=?%d\n“?ac4);

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件?????126976??2011-07-17?12:32??GY-65氣壓模塊發送資料\bmp085模塊引腳圖.JPG

?????文件??????88765??2012-05-24?11:41??GY-65氣壓模塊發送資料\電路圖.jpg

?????文件?????566501??2011-03-31?23:32??GY-65氣壓模塊發送資料\數據手冊\BMP085_Flyer_Rev.0.2_March2008.pdf

?????文件?????842732??2011-02-28?16:29??GY-65氣壓模塊發送資料\數據手冊\BMP085.pdf

?????文件??????12165??2012-06-02?15:39??GY-65氣壓模塊發送資料\GY-65測試程序\51-MCU\51單片機串口輸出BMP085.txt

?????文件?????170671??2011-07-30?14:01??GY-65氣壓模塊發送資料\GY-65測試程序\51-MCU\GY-65氣壓模塊接線圖.jpg

?????文件??????12972??2012-06-02?15:34??GY-65氣壓模塊發送資料\GY-65測試程序\51-MCU\STC51-BMP085?LCD1602測試程序.txt

?????文件???????4623??2011-12-24?23:06??GY-65氣壓模塊發送資料\GY-65測試程序\Arduino\BMP085\BMP085_TEST\BMP085_TEST.pde

?????文件???????2367??2008-04-27?17:21??GY-65氣壓模塊發送資料\GY-65測試程序\AVR\BMP085?Example?Code\ATmega328\defs.h

?????文件???????5123??2010-04-08?13:55??GY-65氣壓模塊發送資料\GY-65測試程序\AVR\BMP085?Example?Code\ATmega328\i2c.h

?????文件???????7216??2011-07-16?21:03??GY-65氣壓模塊發送資料\GY-65測試程序\AVR\BMP085?Example?Code\ATmega328\main.c

?????文件??????12499??2010-04-08?15:11??GY-65氣壓模塊發送資料\GY-65測試程序\AVR\BMP085?Example?Code\ATmega328\main.hex

?????文件??????19518??2010-04-07?13:38??GY-65氣壓模塊發送資料\GY-65測試程序\AVR\BMP085?Example?Code\ATmega328\Makefile

?????文件??????16110??2010-01-09?18:03??GY-65氣壓模塊發送資料\GY-65測試程序\AVR\BMP085?Example?Code\ATmega328\math.h

?????文件???????1521??2007-09-23?13:34??GY-65氣壓模塊發送資料\GY-65測試程序\AVR\BMP085?Example?Code\ATmega328\types.h

?????目錄??????????0??2012-06-02?15:36??GY-65氣壓模塊發送資料\GY-65測試程序\Arduino\BMP085\BMP085_TEST

?????目錄??????????0??2012-06-02?15:40??GY-65氣壓模塊發送資料\GY-65測試程序\AVR\BMP085?Example?Code\ATmega328

?????目錄??????????0??2012-06-02?15:36??GY-65氣壓模塊發送資料\GY-65測試程序\Arduino\BMP085

?????目錄??????????0??2012-06-02?15:40??GY-65氣壓模塊發送資料\GY-65測試程序\AVR\BMP085?Example?Code

?????目錄??????????0??2012-06-02?15:35??GY-65氣壓模塊發送資料\GY-65測試程序\51-MCU

?????目錄??????????0??2012-06-02?15:36??GY-65氣壓模塊發送資料\GY-65測試程序\Arduino

?????目錄??????????0??2012-06-02?15:40??GY-65氣壓模塊發送資料\GY-65測試程序\AVR

?????目錄??????????0??2012-06-02?15:35??GY-65氣壓模塊發送資料\數據手冊

?????目錄??????????0??2012-06-02?15:35??GY-65氣壓模塊發送資料\GY-65測試程序

?????目錄??????????0??2011-07-17?12:25??GY-65氣壓模塊發送資料

-----------?---------??----------?-----??----

??????????????1889759????????????????????25


評論

共有 條評論