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

  • 大小: 530KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2021-06-11
  • 語言: 其他
  • 標簽: Arduino??HMC5883L??

資源簡介

arduino HMMC5883L - 庫文件 支持C與Arduino arduino示例教程

資源截圖

代碼片段和文件信息

/*
HMC5883L.cpp?-?Class?file?for?the?HMC5883L?Triple?Axis?Digital?Compass?Arduino?Library.

Version:?1.1.0
(c)?2014?Korneliusz?Jarzebski
www.jarzebski.pl

This?program?is?free?software:?you?can?redistribute?it?and/or?modify
it?under?the?terms?of?the?version?3?GNU?General?Public?License?as
published?by?the?Free?Software?Foundation.

This?program?is?distributed?in?the?hope?that?it?will?be?useful
but?WITHOUT?ANY?WARRANTY;?without?even?the?implied?warranty?of
MERCHANTABILITY?or?FITNESS?FOR?A?PARTICULAR?PURPOSE.??See?the
GNU?General?Public?License?for?more?details.

You?should?have?received?a?copy?of?the?GNU?General?Public?License
along?with?this?program.??If?not?see?.
*/

#if?ARDUINO?>=?100
#include?“Arduino.h“
#else
#include?“WProgram.h“
#endif

#include?

#include?“HMC5883L.h“

bool?HMC5883L::begin()
{
????Wire.begin();

????if?((fastRegister8(HMC5883L_REG_IDENT_A)?!=?0x48)
????||?(fastRegister8(HMC5883L_REG_IDENT_B)?!=?0x34)
????||?(fastRegister8(HMC5883L_REG_IDENT_C)?!=?0x33))
????{
return?false;
????}

????setRange(HMC5883L_RANGE_1_3GA);
????setMeasurementMode(HMC5883L_CONTINOUS);
????setDataRate(HMC5883L_DATARATE_15HZ);
????setSamples(HMC5883L_SAMPLES_1);

????mgPerDigit?=?0.92f;

????return?true;
}

Vector?HMC5883L::readRaw(void)
{
????v.XAxis?=?readRegister16(HMC5883L_REG_OUT_X_M)?-?xOffset;
????v.YAxis?=?readRegister16(HMC5883L_REG_OUT_Y_M)?-?yOffset;
????v.ZAxis?=?readRegister16(HMC5883L_REG_OUT_Z_M);

????return?v;
}

Vector?HMC5883L::readNormalize(void)
{
????v.XAxis?=?((float)readRegister16(HMC5883L_REG_OUT_X_M)?-?xOffset)?*?mgPerDigit;
????v.YAxis?=?((float)readRegister16(HMC5883L_REG_OUT_Y_M)?-?yOffset)?*?mgPerDigit;
????v.ZAxis?=?(float)readRegister16(HMC5883L_REG_OUT_Z_M)?*?mgPerDigit;

????return?v;
}

void?HMC5883L::setOffset(int?xo?int?yo)
{
????xOffset?=?xo;
????yOffset?=?yo;
}

void?HMC5883L::setRange(hmc5883l_range_t?range)
{
????switch(range)
????{
case?HMC5883L_RANGE_0_88GA:
????mgPerDigit?=?0.073f;
????break;

case?HMC5883L_RANGE_1_3GA:
????mgPerDigit?=?0.92f;
????break;

case?HMC5883L_RANGE_1_9GA:
????mgPerDigit?=?1.22f;
????break;

case?HMC5883L_RANGE_2_5GA:
????mgPerDigit?=?1.52f;
????break;

case?HMC5883L_RANGE_4GA:
????mgPerDigit?=?2.27f;
????break;

case?HMC5883L_RANGE_4_7GA:
????mgPerDigit?=?2.56f;
????break;

case?HMC5883L_RANGE_5_6GA:
????mgPerDigit?=?3.03f;
????break;

case?HMC5883L_RANGE_8_1GA:
????mgPerDigit?=?4.35f;
????break;

default:
????break;
????}

????writeRegister8(HMC5883L_REG_CONFIG_B?range?<}

hmc5883l_range_t?HMC5883L::getRange(void)
{
????return?(hmc5883l_range_t)((readRegister8(HMC5883L_REG_CONFIG_B)?>>?5));
}

void?HMC5883L::setMeasurementMode(hmc5883l_mode_t?mode)
{
????uint8_t?value;

????value?=?readRegister8(HMC5883L_REG_MODE);
????value?&=?0b11111100;
????value?|=?mode;

????writeRegister8(HMC5883L_REG_MODE?value);
}

hmc5883l_mode_t?HMC5883L::getMeasurementMode(void)
{
????uint8_t?value;

????value?=?readRegister8(HM

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

????.......???????653??2017-07-31?16:54??Arduino-HMC5883L-master\CHANGELOG

????.......??????5919??2017-07-31?16:54??Arduino-HMC5883L-master\HMC5883L.cpp

????.......??????3291??2017-07-31?16:54??Arduino-HMC5883L-master\HMC5883L.h

????.......??????1541??2017-07-31?16:54??Arduino-HMC5883L-master\HMC5883L_calibrate\HMC5883L_calibrate.ino

????.......??????1837??2017-07-31?16:54??Arduino-HMC5883L-master\HMC5883L_calibrate_MPU6050\HMC5883L_calibrate_MPU6050.ino

????.......??????1876??2017-07-31?16:54??Arduino-HMC5883L-master\HMC5883L_compass\HMC5883L_compass.ino

????.......??????2349??2017-07-31?16:54??Arduino-HMC5883L-master\HMC5883L_compass_MPU6050\HMC5883L_compass_MPU6050.ino

????.......??????3167??2017-07-31?16:54??Arduino-HMC5883L-master\HMC5883L_compensation_ADXL345\HMC5883L_compensation_ADXL345.ino

????.......??????3293??2017-07-31?16:54??Arduino-HMC5883L-master\HMC5883L_compensation_MPU6050\HMC5883L_compensation_MPU6050.ino

????.......??????2674??2017-07-31?16:54??Arduino-HMC5883L-master\HMC5883L_processing\HMC5883L_processing.ino

????.......??????2970??2017-07-31?16:54??Arduino-HMC5883L-master\HMC5883L_processing_MPU6050\HMC5883L_processing_MPU6050.ino

????.......??????4259??2017-07-31?16:54??Arduino-HMC5883L-master\HMC5883L_simple\HMC5883L_simple.ino

????.......?????35121??2017-07-31?16:54??Arduino-HMC5883L-master\LICENSE

????.......?????71472??2017-07-31?16:54??Arduino-HMC5883L-master\Processing\HMC5883L_calibrate_processing\artificialHorizon.png

????.......?????33031??2017-07-31?16:54??Arduino-HMC5883L-master\Processing\HMC5883L_calibrate_processing\artificialHorizonRing.png

????.......??????1582??2017-07-31?16:54??Arduino-HMC5883L-master\Processing\HMC5883L_calibrate_processing\HMC5883L_calibrate_processing.pde

????.......?????65440??2017-07-31?16:54??Arduino-HMC5883L-master\Processing\HMC5883L_compensation_processing\compass.png

????.......?????56282??2017-07-31?16:54??Arduino-HMC5883L-master\Processing\HMC5883L_compensation_processing\compassPlateBlack.png

????.......?????56429??2017-07-31?16:54??Arduino-HMC5883L-master\Processing\HMC5883L_compensation_processing\compassPlateWhite.png

????.......?????34504??2017-07-31?16:54??Arduino-HMC5883L-master\Processing\HMC5883L_compensation_processing\compassRing.png

????.......??????7323??2017-07-31?16:54??Arduino-HMC5883L-master\Processing\HMC5883L_compensation_processing\HMC5883L_compensation_processing.pde

????.......?????65440??2017-07-31?16:54??Arduino-HMC5883L-master\Processing\HMC5883L_processing\compass.png

????.......?????56282??2017-07-31?16:54??Arduino-HMC5883L-master\Processing\HMC5883L_processing\compassPlateBlack.png

????.......?????56429??2017-07-31?16:54??Arduino-HMC5883L-master\Processing\HMC5883L_processing\compassPlateWhite.png

????.......?????34504??2017-07-31?16:54??Arduino-HMC5883L-master\Processing\HMC5883L_processing\compassRing.png

????.......??????7821??2017-07-31?16:54??Arduino-HMC5883L-master\Processing\HMC5883L_processing\HMC5883L_processing.pde

????.......???????934??2017-07-31?16:54??Arduino-HMC5883L-master\README.md

?????目錄??????????0??2018-02-06?12:38??Arduino-HMC5883L-master\Processing\HMC5883L_calibrate_processing

?????目錄??????????0??2018-02-06?12:38??Arduino-HMC5883L-master\Processing\HMC5883L_compensation_processing

?????目錄??????????0??2018-02-06?12:38??Arduino-HMC5883L-master\Processing\HMC5883L_processing

............此處省略14個文件信息

評論

共有 條評論