Johan Kritzinger
/
FRDMKL25Z-ShiftBrite
A few classes to interface one or more ShiftBrite module to the FRDM KL25Z.
Diff: sbDriver.cpp
- Revision:
- 5:aa0424f31fa1
- Parent:
- 4:d2f8ddb423e2
--- a/sbDriver.cpp Wed Aug 20 09:26:42 2014 +0000 +++ b/sbDriver.cpp Thu Aug 21 04:04:49 2014 +0000 @@ -266,12 +266,15 @@ setLed(moduleCount-1,temp.getRed(),temp.getGreen(),temp.getBlue()); } -void shiftBriteDisplay::shiftLeft(){;//info shifted out is lost, +void shiftBriteDisplay::shiftLeft(unsigned short int inR,unsigned short int inG,unsigned short int inB){;//info shifted out is lost, unsigned int i; for(i=0; i != moduleCount-1; i++){ setLed(i,module_p[i+1].getRed(),module_p[i+1].getGreen(),module_p[i+1].getBlue()); } - setLed(moduleCount-1,0,0,0); + if(inR==0 && inG==0 && inB==0) + setLed(moduleCount-1,0,0,0); + else + setLed(moduleCount-1,inR,inG,inB); } void shiftBriteDisplay::rotateRight(){; @@ -283,12 +286,15 @@ } setLed(0,temp.getRed(),temp.getGreen(),temp.getBlue()); } -void shiftBriteDisplay::shiftRight(){;//info shifted out is lost +void shiftBriteDisplay::shiftRight(unsigned short int inR,unsigned short int inG,unsigned short int inB){;//info shifted out is lost unsigned int i; for(i=moduleCount; i != 0; i--){ setLed(i-1,module_p[i-2].getRed(),module_p[i-2].getGreen(),module_p[i-2].getBlue()); } - setLed(0,0,0,0); + if(inR==0 && inG==0 && inB==0) + setLed(0,0,0,0); + else + setLed(0,inR,inG,inB); } void shiftBriteDisplay::turnOn(){; priv_SBEnable();