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

Method writeN

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

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

Source from the content-addressed store, hash-verified

85// write count values in consecutive PWM registers
86// checks if [channel + count - 1 > 8]
87uint8_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
111uint8_t PCA9634::writeN_noStop(uint8_t channel, uint8_t* arr, uint8_t count)

Callers

nothing calls this directly

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected