#include "piGlow.h"
-static int myBase ;
+#define PIGLOW_BASE 577
static int leg0 [6] = { 6, 7, 8, 5, 4, 9 } ;
static int leg1 [6] = { 17, 16, 15, 13, 11, 10 } ;
else
legLeds = leg2 ;
- analogWrite (myBase + legLeds [ring], intensity) ;
+ analogWrite (PIGLOW_BASE + legLeds [ring], intensity) ;
}
/*
void piGlowLeg (const int leg, const int intensity)
{
- int i ;
+ int i ;
int *legLeds ;
if ((leg < 0) || (leg > 2))
legLeds = leg2 ;
for (i = 0 ; i < 6 ; ++i)
- analogWrite (myBase + legLeds [i], intensity) ;
+ analogWrite (PIGLOW_BASE + legLeds [i], intensity) ;
}
if ((ring < 0) || (ring > 5))
return ;
- analogWrite (myBase + leg0 [ring], intensity) ;
- analogWrite (myBase + leg1 [ring], intensity) ;
- analogWrite (myBase + leg2 [ring], intensity) ;
+ analogWrite (PIGLOW_BASE + leg0 [ring], intensity) ;
+ analogWrite (PIGLOW_BASE + leg1 [ring], intensity) ;
+ analogWrite (PIGLOW_BASE + leg2 [ring], intensity) ;
}
/*
*********************************************************************************
*/
-void piGlowSetup (const int pinBase)
+void piGlowSetup (int clear)
{
- sn3218Setup (myBase = pinBase) ;
-
-// Turn all off to start with
-
- piGlowLeg (0, 0) ;
- piGlowLeg (1, 0) ;
- piGlowLeg (2, 0) ;
+ sn3218Setup (PIGLOW_BASE) ;
+
+ if (clear)
+ {
+ piGlowLeg (0, 0) ;
+ piGlowLeg (1, 0) ;
+ piGlowLeg (2, 0) ;
+ }
}