MCPcopy Create free account
hub / github.com/RobTillaart/Arduino / writeN

Method writeN

libraries/PCA9635/PCA9635.cpp:87–108  ·  view source on GitHub ↗

write count values in consecutive PWM registers checks if [channel + count - 1 > 15]

Source from the content-addressed store, hash-verified

85// write count values in consecutive PWM registers
86// checks if [channel + count - 1 > 15]
87uint8_t PCA9635::writeN(uint8_t channel, uint8_t* arr, uint8_t count)
88{
89 if (channel + count > _channelCount)
90 {
91 _error = PCA9635_ERR_WRITE;
92 return PCA9635_ERROR;
93 }
94 uint8_t base = PCA9635_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 = PCA9635_ERR_I2C;
105 return PCA9635_ERROR;
106 }
107 return PCA9635_OK;
108}
109
110
111uint8_t PCA9635::writeMode(uint8_t reg, uint8_t value)

Callers

nothing calls this directly

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected