Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/SparkFunSX1509.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,16 @@ void SX1509::ledDriverInit(uint8_t pin, uint8_t freq /*= 1*/, bool log /*= false
// Use configClock to setup the clock divder
if (_clkX == 0) // Make clckX non-zero
{
_clkX = 2000000.0 / (1 << (1 - 1)); // Update private clock variable
// _clkX = 2000000.0 / (1 << (1 - 1)); // Update private clock variable
_clkX = 2000000.0;

uint8_t freq = (1 & 0x07) << 4; // freq should only be 3 bits from 6:4
tempByte |= freq;
// uint8_t freq = (1 & 0x07) << 4; // freq should only be 3 bits from 6:4
// tempByte |= freq;
}

freq = (freq & 0x7) << 4; // mask only 3 bits and shift to bit position 6:4
tempByte |= freq;

writeByte(REG_MISC, tempByte);

// Enable LED driver operation (REG_LED_DRIVER_ENABLE)
Expand Down