Balancimg MPU6050 by LEDs on PWM

Dependencies:   mbed

It is possible to observe the MPU6050 data on serial. If serial termimal is not started then still LED application runs.

There are 4 LEDs on LPC1768. So the first 3 LEDs are assign to accelerometer X, Y and Z. The last LED can drive by user. Default it lights a bit. If you want to turn it off then change the value as "190" to "180" on this line: myled4 = cos(190*2.0*3.13/360) * 0.5 + 0.5; If you want to turn it on (full) then change the value as "190" to "0" on above code line.

Committer:
LORDTEK
Date:
Sun Oct 13 12:01:33 2013 +0000
Revision:
0:9a1aae56ed19
Balancing MPU6050 by LEDs

Who changed what in which revision?

UserRevisionLine numberNew contents of line
LORDTEK 0:9a1aae56ed19 1 // ported from arduino library: https://github.com/jrowberg/i2cdevlib
LORDTEK 0:9a1aae56ed19 2 // written by szymon gaertig (email: szymon@gaertig.com.pl, website: szymongaertig.pl)
LORDTEK 0:9a1aae56ed19 3 // Changelog:
LORDTEK 0:9a1aae56ed19 4 // 2013-01-08 - first release
LORDTEK 0:9a1aae56ed19 5
LORDTEK 0:9a1aae56ed19 6 #include "I2Cdev.h"
LORDTEK 0:9a1aae56ed19 7
LORDTEK 0:9a1aae56ed19 8 #define useDebugSerial
LORDTEK 0:9a1aae56ed19 9
LORDTEK 0:9a1aae56ed19 10 I2Cdev::I2Cdev(): debugSerial(USBTX, USBRX), i2c(I2C_SDA,I2C_SCL)
LORDTEK 0:9a1aae56ed19 11 {
LORDTEK 0:9a1aae56ed19 12
LORDTEK 0:9a1aae56ed19 13 }
LORDTEK 0:9a1aae56ed19 14
LORDTEK 0:9a1aae56ed19 15 I2Cdev::I2Cdev(PinName i2cSda, PinName i2cScl): debugSerial(USBTX, USBRX), i2c(i2cSda,i2cScl)
LORDTEK 0:9a1aae56ed19 16 {
LORDTEK 0:9a1aae56ed19 17
LORDTEK 0:9a1aae56ed19 18 }
LORDTEK 0:9a1aae56ed19 19
LORDTEK 0:9a1aae56ed19 20 /** Read a single bit from an 8-bit device register.
LORDTEK 0:9a1aae56ed19 21 * @param devAddr I2C slave device address
LORDTEK 0:9a1aae56ed19 22 * @param regAddr Register regAddr to read from
LORDTEK 0:9a1aae56ed19 23 * @param bitNum Bit position to read (0-7)
LORDTEK 0:9a1aae56ed19 24 * @param data Container for single bit value
LORDTEK 0:9a1aae56ed19 25 * @param timeout Optional read timeout in milliseconds (0 to disable, leave off to use default class value in I2Cdev::readTimeout)
LORDTEK 0:9a1aae56ed19 26 * @return Status of read operation (true = success)
LORDTEK 0:9a1aae56ed19 27 */
LORDTEK 0:9a1aae56ed19 28 int8_t I2Cdev::readBit(uint8_t devAddr, uint8_t regAddr, uint8_t bitNum, uint8_t *data, uint16_t timeout) {
LORDTEK 0:9a1aae56ed19 29 uint8_t b;
LORDTEK 0:9a1aae56ed19 30 uint8_t count = readByte(devAddr, regAddr, &b, timeout);
LORDTEK 0:9a1aae56ed19 31 *data = b & (1 << bitNum);
LORDTEK 0:9a1aae56ed19 32 return count;
LORDTEK 0:9a1aae56ed19 33 }
LORDTEK 0:9a1aae56ed19 34
LORDTEK 0:9a1aae56ed19 35 /** Read a single bit from a 16-bit device register.
LORDTEK 0:9a1aae56ed19 36 * @param devAddr I2C slave device address
LORDTEK 0:9a1aae56ed19 37 * @param regAddr Register regAddr to read from
LORDTEK 0:9a1aae56ed19 38 * @param bitNum Bit position to read (0-15)
LORDTEK 0:9a1aae56ed19 39 * @param data Container for single bit value
LORDTEK 0:9a1aae56ed19 40 * @param timeout Optional read timeout in milliseconds (0 to disable, leave off to use default class value in I2Cdev::readTimeout)
LORDTEK 0:9a1aae56ed19 41 * @return Status of read operation (true = success)
LORDTEK 0:9a1aae56ed19 42 */
LORDTEK 0:9a1aae56ed19 43 int8_t I2Cdev::readBitW(uint8_t devAddr, uint8_t regAddr, uint8_t bitNum, uint16_t *data, uint16_t timeout) {
LORDTEK 0:9a1aae56ed19 44 uint16_t b;
LORDTEK 0:9a1aae56ed19 45 uint8_t count = readWord(devAddr, regAddr, &b, timeout);
LORDTEK 0:9a1aae56ed19 46 *data = b & (1 << bitNum);
LORDTEK 0:9a1aae56ed19 47 return count;
LORDTEK 0:9a1aae56ed19 48 }
LORDTEK 0:9a1aae56ed19 49
LORDTEK 0:9a1aae56ed19 50 /** Read multiple bits from an 8-bit device register.
LORDTEK 0:9a1aae56ed19 51 * @param devAddr I2C slave device address
LORDTEK 0:9a1aae56ed19 52 * @param regAddr Register regAddr to read from
LORDTEK 0:9a1aae56ed19 53 * @param bitStart First bit position to read (0-7)
LORDTEK 0:9a1aae56ed19 54 * @param length Number of bits to read (not more than 8)
LORDTEK 0:9a1aae56ed19 55 * @param data Container for right-aligned value (i.e. '101' read from any bitStart position will equal 0x05)
LORDTEK 0:9a1aae56ed19 56 * @param timeout Optional read timeout in milliseconds (0 to disable, leave off to use default class value in I2Cdev::readTimeout)
LORDTEK 0:9a1aae56ed19 57 * @return Status of read operation (true = success)
LORDTEK 0:9a1aae56ed19 58 */
LORDTEK 0:9a1aae56ed19 59 int8_t I2Cdev::readBits(uint8_t devAddr, uint8_t regAddr, uint8_t bitStart, uint8_t length, uint8_t *data, uint16_t timeout) {
LORDTEK 0:9a1aae56ed19 60 // 01101001 read byte
LORDTEK 0:9a1aae56ed19 61 // 76543210 bit numbers
LORDTEK 0:9a1aae56ed19 62 // xxx args: bitStart=4, length=3
LORDTEK 0:9a1aae56ed19 63 // 010 masked
LORDTEK 0:9a1aae56ed19 64 // -> 010 shifted
LORDTEK 0:9a1aae56ed19 65 uint8_t count, b;
LORDTEK 0:9a1aae56ed19 66 if ((count = readByte(devAddr, regAddr, &b, timeout)) != 0) {
LORDTEK 0:9a1aae56ed19 67 uint8_t mask = ((1 << length) - 1) << (bitStart - length + 1);
LORDTEK 0:9a1aae56ed19 68 b &= mask;
LORDTEK 0:9a1aae56ed19 69 b >>= (bitStart - length + 1);
LORDTEK 0:9a1aae56ed19 70 *data = b;
LORDTEK 0:9a1aae56ed19 71 }
LORDTEK 0:9a1aae56ed19 72 return count;
LORDTEK 0:9a1aae56ed19 73 }
LORDTEK 0:9a1aae56ed19 74
LORDTEK 0:9a1aae56ed19 75 /** Read multiple bits from a 16-bit device register.
LORDTEK 0:9a1aae56ed19 76 * @param devAddr I2C slave device address
LORDTEK 0:9a1aae56ed19 77 * @param regAddr Register regAddr to read from
LORDTEK 0:9a1aae56ed19 78 * @param bitStart First bit position to read (0-15)
LORDTEK 0:9a1aae56ed19 79 * @param length Number of bits to read (not more than 16)
LORDTEK 0:9a1aae56ed19 80 * @param data Container for right-aligned value (i.e. '101' read from any bitStart position will equal 0x05)
LORDTEK 0:9a1aae56ed19 81 * @param timeout Optional read timeout in milliseconds (0 to disable, leave off to use default class value in I2Cdev::readTimeout)
LORDTEK 0:9a1aae56ed19 82 * @return Status of read operation (1 = success, 0 = failure, -1 = timeout)
LORDTEK 0:9a1aae56ed19 83 */
LORDTEK 0:9a1aae56ed19 84 int8_t I2Cdev::readBitsW(uint8_t devAddr, uint8_t regAddr, uint8_t bitStart, uint8_t length, uint16_t *data, uint16_t timeout) {
LORDTEK 0:9a1aae56ed19 85 // 1101011001101001 read byte
LORDTEK 0:9a1aae56ed19 86 // fedcba9876543210 bit numbers
LORDTEK 0:9a1aae56ed19 87 // xxx args: bitStart=12, length=3
LORDTEK 0:9a1aae56ed19 88 // 010 masked
LORDTEK 0:9a1aae56ed19 89 // -> 010 shifted
LORDTEK 0:9a1aae56ed19 90 uint8_t count;
LORDTEK 0:9a1aae56ed19 91 uint16_t w;
LORDTEK 0:9a1aae56ed19 92 if ((count = readWord(devAddr, regAddr, &w, timeout)) != 0) {
LORDTEK 0:9a1aae56ed19 93 uint16_t mask = ((1 << length) - 1) << (bitStart - length + 1);
LORDTEK 0:9a1aae56ed19 94 w &= mask;
LORDTEK 0:9a1aae56ed19 95 w >>= (bitStart - length + 1);
LORDTEK 0:9a1aae56ed19 96 *data = w;
LORDTEK 0:9a1aae56ed19 97 }
LORDTEK 0:9a1aae56ed19 98 return count;
LORDTEK 0:9a1aae56ed19 99 }
LORDTEK 0:9a1aae56ed19 100 /** Read single byte from an 8-bit device register.
LORDTEK 0:9a1aae56ed19 101 * @param devAddr I2C slave device address
LORDTEK 0:9a1aae56ed19 102 * @param regAddr Register regAddr to read from
LORDTEK 0:9a1aae56ed19 103 * @param data Container for byte value read from device
LORDTEK 0:9a1aae56ed19 104 * @param timeout Optional read timeout in milliseconds (0 to disable, leave off to use default class value in I2Cdev::readTimeout)
LORDTEK 0:9a1aae56ed19 105 * @return Status of read operation (true = success)
LORDTEK 0:9a1aae56ed19 106 */
LORDTEK 0:9a1aae56ed19 107 int8_t I2Cdev::readByte(uint8_t devAddr, uint8_t regAddr, uint8_t *data, uint16_t timeout) {
LORDTEK 0:9a1aae56ed19 108 return readBytes(devAddr, regAddr, 1, data, timeout);
LORDTEK 0:9a1aae56ed19 109 }
LORDTEK 0:9a1aae56ed19 110
LORDTEK 0:9a1aae56ed19 111 /** Read single word from a 16-bit device register.
LORDTEK 0:9a1aae56ed19 112 * @param devAddr I2C slave device address
LORDTEK 0:9a1aae56ed19 113 * @param regAddr Register regAddr to read from
LORDTEK 0:9a1aae56ed19 114 * @param data Container for word value read from device
LORDTEK 0:9a1aae56ed19 115 * @param timeout Optional read timeout in milliseconds (0 to disable, leave off to use default class value in I2Cdev::readTimeout)
LORDTEK 0:9a1aae56ed19 116 * @return Status of read operation (true = success)
LORDTEK 0:9a1aae56ed19 117 */
LORDTEK 0:9a1aae56ed19 118 int8_t I2Cdev::readWord(uint8_t devAddr, uint8_t regAddr, uint16_t *data, uint16_t timeout) {
LORDTEK 0:9a1aae56ed19 119 return readWords(devAddr, regAddr, 1, data, timeout);
LORDTEK 0:9a1aae56ed19 120 }
LORDTEK 0:9a1aae56ed19 121
LORDTEK 0:9a1aae56ed19 122 /** Read multiple bytes from an 8-bit device register.
LORDTEK 0:9a1aae56ed19 123 * @param devAddr I2C slave device address
LORDTEK 0:9a1aae56ed19 124 * @param regAddr First register regAddr to read from
LORDTEK 0:9a1aae56ed19 125 * @param length Number of bytes to read
LORDTEK 0:9a1aae56ed19 126 * @param data Buffer to store read data in
LORDTEK 0:9a1aae56ed19 127 * @param timeout Optional read timeout in milliseconds (0 to disable, leave off to use default class value in I2Cdev::readTimeout)
LORDTEK 0:9a1aae56ed19 128 * @return Number of bytes read (-1 indicates failure)
LORDTEK 0:9a1aae56ed19 129 */
LORDTEK 0:9a1aae56ed19 130 int8_t I2Cdev::readBytes(uint8_t devAddr, uint8_t regAddr, uint8_t length, uint8_t *data, uint16_t timeout)
LORDTEK 0:9a1aae56ed19 131 {
LORDTEK 0:9a1aae56ed19 132 char command[1];
LORDTEK 0:9a1aae56ed19 133 command[0] = regAddr;
LORDTEK 0:9a1aae56ed19 134 char *redData = (char*)malloc(length);
LORDTEK 0:9a1aae56ed19 135 i2c.write(devAddr<<1, command, 1, true);
LORDTEK 0:9a1aae56ed19 136 i2c.read(devAddr<<1, redData, length);
LORDTEK 0:9a1aae56ed19 137 for(int i =0; i < length; i++) {
LORDTEK 0:9a1aae56ed19 138 data[i] = redData[i];
LORDTEK 0:9a1aae56ed19 139 }
LORDTEK 0:9a1aae56ed19 140 return length;
LORDTEK 0:9a1aae56ed19 141 }
LORDTEK 0:9a1aae56ed19 142
LORDTEK 0:9a1aae56ed19 143 int8_t I2Cdev::readWords(uint8_t devAddr, uint8_t regAddr, uint8_t length, uint16_t *data, uint16_t timeout)
LORDTEK 0:9a1aae56ed19 144 {
LORDTEK 0:9a1aae56ed19 145 return 0;
LORDTEK 0:9a1aae56ed19 146 }
LORDTEK 0:9a1aae56ed19 147
LORDTEK 0:9a1aae56ed19 148 /** write a single bit in an 8-bit device register.
LORDTEK 0:9a1aae56ed19 149 * @param devAddr I2C slave device address
LORDTEK 0:9a1aae56ed19 150 * @param regAddr Register regAddr to write to
LORDTEK 0:9a1aae56ed19 151 * @param bitNum Bit position to write (0-7)
LORDTEK 0:9a1aae56ed19 152 * @param value New bit value to write
LORDTEK 0:9a1aae56ed19 153 * @return Status of operation (true = success)
LORDTEK 0:9a1aae56ed19 154 */
LORDTEK 0:9a1aae56ed19 155 bool I2Cdev::writeBit(uint8_t devAddr, uint8_t regAddr, uint8_t bitNum, uint8_t data) {
LORDTEK 0:9a1aae56ed19 156 uint8_t b;
LORDTEK 0:9a1aae56ed19 157 readByte(devAddr, regAddr, &b);
LORDTEK 0:9a1aae56ed19 158 b = (data != 0) ? (b | (1 << bitNum)) : (b & ~(1 << bitNum));
LORDTEK 0:9a1aae56ed19 159 return writeByte(devAddr, regAddr, b);
LORDTEK 0:9a1aae56ed19 160 }
LORDTEK 0:9a1aae56ed19 161
LORDTEK 0:9a1aae56ed19 162 /** write a single bit in a 16-bit device register.
LORDTEK 0:9a1aae56ed19 163 * @param devAddr I2C slave device address
LORDTEK 0:9a1aae56ed19 164 * @param regAddr Register regAddr to write to
LORDTEK 0:9a1aae56ed19 165 * @param bitNum Bit position to write (0-15)
LORDTEK 0:9a1aae56ed19 166 * @param value New bit value to write
LORDTEK 0:9a1aae56ed19 167 * @return Status of operation (true = success)
LORDTEK 0:9a1aae56ed19 168 */
LORDTEK 0:9a1aae56ed19 169 bool I2Cdev::writeBitW(uint8_t devAddr, uint8_t regAddr, uint8_t bitNum, uint16_t data) {
LORDTEK 0:9a1aae56ed19 170 uint16_t w;
LORDTEK 0:9a1aae56ed19 171 readWord(devAddr, regAddr, &w);
LORDTEK 0:9a1aae56ed19 172 w = (data != 0) ? (w | (1 << bitNum)) : (w & ~(1 << bitNum));
LORDTEK 0:9a1aae56ed19 173 return writeWord(devAddr, regAddr, w);
LORDTEK 0:9a1aae56ed19 174 }
LORDTEK 0:9a1aae56ed19 175
LORDTEK 0:9a1aae56ed19 176 /** Write multiple bits in an 8-bit device register.
LORDTEK 0:9a1aae56ed19 177 * @param devAddr I2C slave device address
LORDTEK 0:9a1aae56ed19 178 * @param regAddr Register regAddr to write to
LORDTEK 0:9a1aae56ed19 179 * @param bitStart First bit position to write (0-7)
LORDTEK 0:9a1aae56ed19 180 * @param length Number of bits to write (not more than 8)
LORDTEK 0:9a1aae56ed19 181 * @param data Right-aligned value to write
LORDTEK 0:9a1aae56ed19 182 * @return Status of operation (true = success)
LORDTEK 0:9a1aae56ed19 183 */
LORDTEK 0:9a1aae56ed19 184 bool I2Cdev::writeBits(uint8_t devAddr, uint8_t regAddr, uint8_t bitStart, uint8_t length, uint8_t data) {
LORDTEK 0:9a1aae56ed19 185 // 010 value to write
LORDTEK 0:9a1aae56ed19 186 // 76543210 bit numbers
LORDTEK 0:9a1aae56ed19 187 // xxx args: bitStart=4, length=3
LORDTEK 0:9a1aae56ed19 188 // 00011100 mask byte
LORDTEK 0:9a1aae56ed19 189 // 10101111 original value (sample)
LORDTEK 0:9a1aae56ed19 190 // 10100011 original & ~mask
LORDTEK 0:9a1aae56ed19 191 // 10101011 masked | value
LORDTEK 0:9a1aae56ed19 192 uint8_t b;
LORDTEK 0:9a1aae56ed19 193 if (readByte(devAddr, regAddr, &b) != 0) {
LORDTEK 0:9a1aae56ed19 194 uint8_t mask = ((1 << length) - 1) << (bitStart - length + 1);
LORDTEK 0:9a1aae56ed19 195 data <<= (bitStart - length + 1); // shift data into correct position
LORDTEK 0:9a1aae56ed19 196 data &= mask; // zero all non-important bits in data
LORDTEK 0:9a1aae56ed19 197 b &= ~(mask); // zero all important bits in existing byte
LORDTEK 0:9a1aae56ed19 198 b |= data; // combine data with existing byte
LORDTEK 0:9a1aae56ed19 199 return writeByte(devAddr, regAddr, b);
LORDTEK 0:9a1aae56ed19 200 } else {
LORDTEK 0:9a1aae56ed19 201 return false;
LORDTEK 0:9a1aae56ed19 202 }
LORDTEK 0:9a1aae56ed19 203 }
LORDTEK 0:9a1aae56ed19 204
LORDTEK 0:9a1aae56ed19 205 /** Write multiple bits in a 16-bit device register.
LORDTEK 0:9a1aae56ed19 206 * @param devAddr I2C slave device address
LORDTEK 0:9a1aae56ed19 207 * @param regAddr Register regAddr to write to
LORDTEK 0:9a1aae56ed19 208 * @param bitStart First bit position to write (0-15)
LORDTEK 0:9a1aae56ed19 209 * @param length Number of bits to write (not more than 16)
LORDTEK 0:9a1aae56ed19 210 * @param data Right-aligned value to write
LORDTEK 0:9a1aae56ed19 211 * @return Status of operation (true = success)
LORDTEK 0:9a1aae56ed19 212 */
LORDTEK 0:9a1aae56ed19 213 bool I2Cdev::writeBitsW(uint8_t devAddr, uint8_t regAddr, uint8_t bitStart, uint8_t length, uint16_t data) {
LORDTEK 0:9a1aae56ed19 214 // 010 value to write
LORDTEK 0:9a1aae56ed19 215 // fedcba9876543210 bit numbers
LORDTEK 0:9a1aae56ed19 216 // xxx args: bitStart=12, length=3
LORDTEK 0:9a1aae56ed19 217 // 0001110000000000 mask byte
LORDTEK 0:9a1aae56ed19 218 // 1010111110010110 original value (sample)
LORDTEK 0:9a1aae56ed19 219 // 1010001110010110 original & ~mask
LORDTEK 0:9a1aae56ed19 220 // 1010101110010110 masked | value
LORDTEK 0:9a1aae56ed19 221 uint16_t w;
LORDTEK 0:9a1aae56ed19 222 if (readWord(devAddr, regAddr, &w) != 0) {
LORDTEK 0:9a1aae56ed19 223 uint8_t mask = ((1 << length) - 1) << (bitStart - length + 1);
LORDTEK 0:9a1aae56ed19 224 data <<= (bitStart - length + 1); // shift data into correct position
LORDTEK 0:9a1aae56ed19 225 data &= mask; // zero all non-important bits in data
LORDTEK 0:9a1aae56ed19 226 w &= ~(mask); // zero all important bits in existing word
LORDTEK 0:9a1aae56ed19 227 w |= data; // combine data with existing word
LORDTEK 0:9a1aae56ed19 228 return writeWord(devAddr, regAddr, w);
LORDTEK 0:9a1aae56ed19 229 } else {
LORDTEK 0:9a1aae56ed19 230 return false;
LORDTEK 0:9a1aae56ed19 231 }
LORDTEK 0:9a1aae56ed19 232 }
LORDTEK 0:9a1aae56ed19 233
LORDTEK 0:9a1aae56ed19 234 /** Write single byte to an 8-bit device register.
LORDTEK 0:9a1aae56ed19 235 * @param devAddr I2C slave device address
LORDTEK 0:9a1aae56ed19 236 * @param regAddr Register address to write to
LORDTEK 0:9a1aae56ed19 237 * @param data New byte value to write
LORDTEK 0:9a1aae56ed19 238 * @return Status of operation (true = success)
LORDTEK 0:9a1aae56ed19 239 */
LORDTEK 0:9a1aae56ed19 240 bool I2Cdev::writeByte(uint8_t devAddr, uint8_t regAddr, uint8_t data) {
LORDTEK 0:9a1aae56ed19 241 return writeBytes(devAddr, regAddr, 1, &data);
LORDTEK 0:9a1aae56ed19 242 }
LORDTEK 0:9a1aae56ed19 243
LORDTEK 0:9a1aae56ed19 244 /** Write single word to a 16-bit device register.
LORDTEK 0:9a1aae56ed19 245 * @param devAddr I2C slave device address
LORDTEK 0:9a1aae56ed19 246 * @param regAddr Register address to write to
LORDTEK 0:9a1aae56ed19 247 * @param data New word value to write
LORDTEK 0:9a1aae56ed19 248 * @return Status of operation (true = success)
LORDTEK 0:9a1aae56ed19 249 */
LORDTEK 0:9a1aae56ed19 250 bool I2Cdev::writeWord(uint8_t devAddr, uint8_t regAddr, uint16_t data) {
LORDTEK 0:9a1aae56ed19 251 return writeWords(devAddr, regAddr, 1, &data);
LORDTEK 0:9a1aae56ed19 252 }
LORDTEK 0:9a1aae56ed19 253
LORDTEK 0:9a1aae56ed19 254 bool I2Cdev::writeBytes(uint8_t devAddr, uint8_t regAddr, uint8_t length, uint8_t *data)
LORDTEK 0:9a1aae56ed19 255 {
LORDTEK 0:9a1aae56ed19 256 i2c.start();
LORDTEK 0:9a1aae56ed19 257 i2c.write(devAddr<<1);
LORDTEK 0:9a1aae56ed19 258 i2c.write(regAddr);
LORDTEK 0:9a1aae56ed19 259 for(int i = 0; i < length; i++) {
LORDTEK 0:9a1aae56ed19 260 i2c.write(data[i]);
LORDTEK 0:9a1aae56ed19 261 }
LORDTEK 0:9a1aae56ed19 262 i2c.stop();
LORDTEK 0:9a1aae56ed19 263 return true;
LORDTEK 0:9a1aae56ed19 264 }
LORDTEK 0:9a1aae56ed19 265
LORDTEK 0:9a1aae56ed19 266 bool I2Cdev::writeWords(uint8_t devAddr, uint8_t regAddr, uint8_t length, uint16_t *data)
LORDTEK 0:9a1aae56ed19 267 {
LORDTEK 0:9a1aae56ed19 268 return true;
LORDTEK 0:9a1aae56ed19 269 }
LORDTEK 0:9a1aae56ed19 270
LORDTEK 0:9a1aae56ed19 271 uint16_t I2Cdev::readTimeout(void)
LORDTEK 0:9a1aae56ed19 272 {
LORDTEK 0:9a1aae56ed19 273 return 0;
LORDTEK 0:9a1aae56ed19 274 }