• 大小: 295KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-14
  • 语言: 其他
  • 标签: arduino  i2c    

资源简介

I2C相关库文件 AD7746 Restructure repository to better support multiple platforms 2 years ago ADS1115 Fix issue when changing MUX or PGA, an invalid result is 9 months ago ADXL345 Updating I2Cdev class and various devices 5 months ago AK8975 Updating I2Cdev class and various devices 5 months ago BMA150 Restructure repository to better support multiple platforms 2 years ago BMP085 Changed incorrectly-named BMA085 to BMP085 a year ago DS1307 Restructure repository to better support multiple platforms 2 years ago HMC5843 Restructure repository to better support multiple platforms 2 years ago HMC5883L added heading calculation in degrees 9 months ago I2Cdev Updating I2Cdev.* files for Arduino again 5 months ago IAQ2000 Restructure repository to better support multiple platforms 2 years ago ITG3200 Restructure repository to better support multiple platforms 2 years ago L3G4200D Updated example for consistency 6 months ago LM73 Added LM73 driver with basic functionality. a year ago MPR121 Restructure repository to better support multiple platforms 2 years ago MPU6050 PROGMEM compatibility for ARM Processors 11 days ago SSD1308 Restructure repository to better support multiple platforms 2 years ago TCA6424A Restructure repository to better support multiple platforms 2 years ago _Stub Restructure repository to better support multiple platforms

资源截图

代码片段和文件信息

// I2Cdev library collection - AD7746 I2C device class
// based on Analog Devices AD7746 Datasheet Revision 0 2005
// 2012-04-01 by Peteris Skorovs 
//
// This I2C device library is using (and submitted as a part of) Jeff Rowberg‘s I2Cdevlib library
// which should (hopefully) always be available at https://github.com/jrowberg/i2cdevlib
//
// Changelog:
//     2012-04-01 - initial release

/* ============================================
I2Cdev device library code is placed under the MIT license
Copyright (c) 2012 Peteris Skorovs

Permission is hereby granted free of charge to any person obtaining a copy
of this software and associated documentation files (the “Software“) to deal
in the Software without restriction including without limitation the rights
to use copy modify merge publish distribute sublicense and/or sell
copies of the Software and to permit persons to whom the Software is
furnished to do so subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS“ WITHOUT WARRANTY OF ANY KIND EXPRESS OR
IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM DAMAGES OR OTHER
LIABILITY WHETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING FROM
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
===============================================
*/

#include “AD7746.h“

/** Default constructor uses default I2C address.
 * @see AD7746_DEFAULT_ADDRESS
 */
AD7746::AD7746() {
    devAddr = AD7746_DEFAULT_ADDRESS;
}

/** Specific address constructor.
 * @param address I2C address
 * @see AD7746_DEFAULT_ADDRESS
 * @see AD7746_ADDRESS
 */
AD7746::AD7746(uint8_t address) {
    devAddr = address;
}

/** Power on and prepare for general usage.
 */
void AD7746::initialize() {
    reset();
}

/** Verify the I2C connection.
 * Make sure the device is connected and responds as expected.
 * @return True if connection is valid false otherwise
 */
bool AD7746::testConnection() {
    if (I2Cdev::readByte(devAddr AD7746_RA_STATUS buffer)) {
        return true;
    }
    return false;
}

void AD7746::reset() {   
    
#ifdef I2CDEV_SERIAL_DEBUG
    Serial.print(“I2C (0x“);
    Serial.print(devAddr HEX);
    Serial.print(“) resetting“);
    Serial.print(“...“);
#endif    

#if ((I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE && ARDUINO < 100) || I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_NBWIRE)
    Wire.beginTransmission(devAddr);
    Wire.send((uint8_t) AD7746_RESET); // send reset
#elif (I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE && ARDUINO >= 100)
    Wire.beginTransmission(devAddr);
    Wire.write((uint8_t) AD7746_RESET)

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2014-01-21 11:56  i2cdevlib-master\
     目录           0  2014-01-21 11:56  i2cdevlib-master\Arduino\
     目录           0  2014-01-21 11:56  i2cdevlib-master\Arduino\AD7746\
     文件        4365  2014-01-21 11:56  i2cdevlib-master\Arduino\AD7746\AD7746.cpp
     文件        7664  2014-01-21 11:56  i2cdevlib-master\Arduino\AD7746\AD7746.h
     目录           0  2014-01-21 11:56  i2cdevlib-master\Arduino\ADS1115\
     文件       21674  2014-01-21 11:56  i2cdevlib-master\Arduino\ADS1115\ADS1115.cpp
     文件        7359  2014-01-21 11:56  i2cdevlib-master\Arduino\ADS1115\ADS1115.h
     目录           0  2014-01-21 11:56  i2cdevlib-master\Arduino\ADS1115\Examples\
     目录           0  2014-01-21 11:56  i2cdevlib-master\Arduino\ADS1115\Examples\ADS1115_differential\
     文件        3565  2014-01-21 11:56  i2cdevlib-master\Arduino\ADS1115\Examples\ADS1115_differential\ADS1115_differential.ino
     目录           0  2014-01-21 11:56  i2cdevlib-master\Arduino\ADXL345\
     文件       62350  2014-01-21 11:56  i2cdevlib-master\Arduino\ADXL345\ADXL345.cpp
     文件       12875  2014-01-21 11:56  i2cdevlib-master\Arduino\ADXL345\ADXL345.h
     目录           0  2014-01-21 11:56  i2cdevlib-master\Arduino\ADXL345\Examples\
     目录           0  2014-01-21 11:56  i2cdevlib-master\Arduino\ADXL345\Examples\ADXL345_raw\
     文件        3129  2014-01-21 11:56  i2cdevlib-master\Arduino\ADXL345\Examples\ADXL345_raw\ADXL345_raw.ino
     目录           0  2014-01-21 11:56  i2cdevlib-master\Arduino\AK8975\
     文件        5769  2014-01-21 11:56  i2cdevlib-master\Arduino\AK8975\AK8975.cpp
     文件        4426  2014-01-21 11:56  i2cdevlib-master\Arduino\AK8975\AK8975.h
     目录           0  2014-01-21 11:56  i2cdevlib-master\Arduino\AK8975\Examples\
     目录           0  2014-01-21 11:56  i2cdevlib-master\Arduino\AK8975\Examples\AK8975_MPUEVB_heading\
     文件        4537  2014-01-21 11:56  i2cdevlib-master\Arduino\AK8975\Examples\AK8975_MPUEVB_heading\AK8975_MPUEVB_heading.ino
     目录           0  2014-01-21 11:56  i2cdevlib-master\Arduino\AK8975\Examples\AK8975_MPUEVB_raw\
     文件        4246  2014-01-21 11:56  i2cdevlib-master\Arduino\AK8975\Examples\AK8975_MPUEVB_raw\AK8975_MPUEVB_raw.ino
     目录           0  2014-01-21 11:56  i2cdevlib-master\Arduino\AK8975\Examples\AK8975_raw\
     文件        3173  2014-01-21 11:56  i2cdevlib-master\Arduino\AK8975\Examples\AK8975_raw\AK8975_raw.ino
     目录           0  2014-01-21 11:56  i2cdevlib-master\Arduino\BMA150\
     文件       16766  2014-01-21 11:56  i2cdevlib-master\Arduino\BMA150\BMA150.cpp
     文件        9519  2014-01-21 11:56  i2cdevlib-master\Arduino\BMA150\BMA150.h
     目录           0  2014-01-21 11:56  i2cdevlib-master\Arduino\BMA150\examples\
............此处省略97个文件信息

评论

共有 条评论