From a8c8a6a0d9dcc78237cbf5419c4874136d608aa8 Mon Sep 17 00:00:00 2001 From: "T. van der Zwan" Date: Fri, 20 Mar 2015 21:11:39 +0100 Subject: [PATCH] Second attempt to fix the pi-blaster device Former-commit-id: 53764c0169093bb50e0e9a64dc9112c3bebdf0f4 --- libsrc/leddevice/LedDevicePiBlaster.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libsrc/leddevice/LedDevicePiBlaster.cpp b/libsrc/leddevice/LedDevicePiBlaster.cpp index 2606a250..9fe02a8b 100644 --- a/libsrc/leddevice/LedDevicePiBlaster.cpp +++ b/libsrc/leddevice/LedDevicePiBlaster.cpp @@ -83,10 +83,10 @@ int LedDevicePiBlaster::write(const std::vector & ledValues) std::vector iPins = {4, 17, 18, 27, 21, 22, 23, 24, 25}; unsigned colorIdx = 0; - for (std::vector::iterator it = iPins.begin(); it != iPins.end(); ++it) + for (unsigned iPin=0; iPin & ledValues) continue; } - fprintf(_fid, "%i=%f\n", iChannel, pwmDutyCycle); + fprintf(_fid, "%i=%f\n", iPins[iPin], pwmDutyCycle); fflush(_fid); } @@ -121,11 +121,11 @@ int LedDevicePiBlaster::switchOff() std::vector iPins = {4, 17, 18, 21, 22, 23, 24, 25}; - for (std::vector::iterator it = iPins.begin(); it != iPins.end(); ++it) + for (unsigned iPin=0; iPin