write count values in consecutive PWM registers checks if [channel + count - 1 > 8]
| 85 | // write count values in consecutive PWM registers |
| 86 | // checks if [channel + count - 1 > 8] |
| 87 | uint8_t PCA9634::writeN(uint8_t channel, uint8_t* arr, uint8_t count) |
| 88 | { |
| 89 | if (channel + count > _channelCount) |
| 90 | { |
| 91 | _error = PCA9634_ERR_WRITE; |
| 92 | return PCA9634_ERROR; |
| 93 | } |
| 94 | uint8_t base = PCA9634_PWM(channel); |
| 95 | _wire->beginTransmission(_address); |
| 96 | _wire->write(base); |
| 97 | for(uint8_t i = 0; i < count; i++) |
| 98 | { |
| 99 | _wire->write(arr[i]); |
| 100 | } |
| 101 | _error = _wire->endTransmission(); |
| 102 | if (_error != 0) |
| 103 | { |
| 104 | _error = PCA9634_ERR_I2C; |
| 105 | return PCA9634_ERROR; |
| 106 | } |
| 107 | return PCA9634_OK; |
| 108 | } |
| 109 | |
| 110 | |
| 111 | uint8_t PCA9634::writeN_noStop(uint8_t channel, uint8_t* arr, uint8_t count) |