mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Merge pull request #257 from pckhib/patch-1
Update LedDevicePiBlaster.cpp Former-commit-id: 8ca0054753652bddd61dde03bfa3ce143ba4649a
This commit is contained in:
commit
0823ba4513
@ -80,11 +80,13 @@ int LedDevicePiBlaster::write(const std::vector<ColorRgb> & ledValues)
|
||||
return -1;
|
||||
}
|
||||
|
||||
std::vector<int> iPins = {4, 17, 18, 27, 21, 22, 23, 24, 25};
|
||||
|
||||
unsigned colorIdx = 0;
|
||||
for (unsigned iChannel=0; iChannel<8; ++iChannel)
|
||||
for (std::vector<int>::iterator it = iPins.begin; it != iPins.end(); ++it)
|
||||
{
|
||||
double pwmDutyCycle = 0.0;
|
||||
switch (_channelAssignment[iChannel])
|
||||
switch (_channelAssignment[*it])
|
||||
{
|
||||
case 'r':
|
||||
pwmDutyCycle = ledValues[colorIdx].red / 255.0;
|
||||
@ -117,11 +119,13 @@ int LedDevicePiBlaster::switchOff()
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (unsigned iChannel=0; iChannel<8; ++iChannel)
|
||||
std::vector<int> iPins = {4, 17, 18, 21, 22, 23, 24, 25};
|
||||
|
||||
for (std::vector<int>::iterator it = iPins.begin; it != iPins.end(); ++it)
|
||||
{
|
||||
if (_channelAssignment[iChannel] != ' ')
|
||||
if (_channelAssignment[*it] != ' ')
|
||||
{
|
||||
fprintf(_fid, "%i=%f\n", iChannel, 0.0);
|
||||
fprintf(_fid, "%i=%f\n", *it, 0.0);
|
||||
fflush(_fid);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user