void ModeDimmer( unsigned char C, unsigned int s, unsigned char IRme)
{
// C = 3-bit default color(R,G,B,Y,C,M,W)
// s = solar (dark = 40-60, light = 128 -136)avg
IRmode = IRme; // IRme = IRmode sets up variables irrelevant here
unsigned char R = 0,G = 0,B = 0; // passed to global too soon, fixed here
if (C==1 || C==4 || C==6 || C==7){R = 255;}
if (C==2 || C==4 || C==5 || C==7){G = 255;}
if (C==3 || C==5 || C==6 || C==7){B = 255;}
float Im = ((float)(s - solarMin)/(float)(solarMax-solarMin));
Im = Im * Im; // need next to find a good gravity equation
if (Im > 1){Im = 1;}
if (Im < 0){Im = 0;}
// now ready to be global, 255 = on, 1 = 1/255 pulse, 0 = off
setColor(((unsigned char)((float)R * Im)),
((unsigned char)((float)G * Im)),
((unsigned char)((float)B * Im)));
//// debug complete! data returns proper values, save the eeprom!
// Im *=100;
// eeprom_write(0, Blue);
// eeprom_write(1, Im);
// eeprom_write(3, Red);
// eeprom_write(4, Green);
// eeprom_write(5, s);
// eeprom_write(6, solarMin);
// eeprom_write(7, solarMax);
// delayMS(1000);
}