User manual
IDUINO for maker’s life
www.openplatform.cc
Serial.println("->WB End");
g_array[2] = g_count;
TSC_WB(HIGH, LOW);
break;
default:
g_count = 0;
break;
}
}
void TSC_WB(int Level0, int Level1) //White Balance
{
g_count = 0;
g_flag ++;
TSC_FilterColor(Level0, Level1);
Timer1.setPeriod(1000000);
}
void setup()
{
TSC_Init();
lcd.init();
delay(100);
lcd.backlight();
Wire.begin();
delay(100);
lcd.setCursor(14,0);
lcd.print("Color");
lcd.setCursor(0,3);
lcd.print("S0:2 S1:3 S2:4 S3:5 OUT:6 LED:-");
Serial.begin(9600);
Timer1.initialize(); // defaulte is 1s
Timer1.attachInterrupt(TSC_Callback);
attachInterrupt(0, TSC_Count, RISING);
delay(4000);
for(int i=0; i<3; i++)
Serial.println(g_array[i]);
g_SF[0] = 255.0/ g_array[0]; //R Scale factor
g_SF[1] = 255.0/ g_array[1] ; //G Scale factor
g_SF[2] = 255.0/ g_array[2] ; //B Scale factor
Serial.println(g_SF[0]);
Serial.println(g_SF[1]);
Serial.println(g_SF[2]);