很多客戶拿到我們ZC-CLS381RGB全彩顏色傳感器 后問 這個傳感器怎么做白平衡校準? 今天就為大家解答一下。
1. 結構示意圖:
綠色:PCB電路板
紅色:白光LED
黑色:RGB傳感器
黃色:導光柱
藍色:TP蓋板
2. 校準流程:
2-1:備妥白色或灰卡(RBG數值相同)當做校準標準件
2-2:將白色或灰卡緊貼TP蓋板
2-3:軟件讀取RGB Rawdata
2-4:取G Rawdata為參考點,將R/B校準至G相同數值的系數存到EEPROM or
flash內.即完成校準動作.
3. 參考作法:
void init()
{
R_factor = 1;
B_factor = 1;
}
Void RGB_read()
{
R= Read R chanel rawdata * R_factor;
G= Read G chanel rawdata;
B= Read B chanel rawdata * B_factor;
}
Void Calibration_R_B_factor()
{
R= Read R chanel rawdata ;
G= Read G chanel rawdata;
B= Read B chanel rawdata ;
R_factor = G/R;
B_factor = G/B; ----> write to EEPROM or flash
}