| 130 | |
| 131 | |
| 132 | void MSP300::_read(uint8_t bytes) |
| 133 | { |
| 134 | if (_wire->requestFrom(_address, bytes) != bytes) |
| 135 | { |
| 136 | _error = MSP300_ERROR; |
| 137 | return; // keep last value |
| 138 | } |
| 139 | _raw = 0; |
| 140 | for (int i= 0; i < bytes; i++) |
| 141 | { |
| 142 | _raw <<= 8; |
| 143 | _raw = _wire->read(); |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | |
| 148 | // -- END OF FILE -- |