我按照找到的例子写了设置sequence并投影的例子,实际操作时用11张8位的图合成11张24位的图下载到flash里面,然后代码可以设置每次投8位的sequence,但是我换成用22张1位的图合成一张24位的图后,sequence里面每个pattern取R/G/B的8个位深度中的一个如G0,结果代码就不好使了,曝光时间设置就没用了,然后投影出来的颜色也不是之前设置的电流颜色了。
代码如下,我想问下投射八位时和投射一位的有什么区别。
int ret = -1;
if (DLPC350_USB_IsConnected())
{
ret = DLPC350_USB_Close();
if (ret != ExcuteSuccess)
{
cout << "USB close Fail,ret =" << ret << endl;
}
}
ret = DLPC350_USB_Init();
ret = DLPC350_USB_Open();
if (ret != ExcuteSuccess)
{
cout << "USB open Fail,status =" << ret << endl;
}
else
{
cout << "USB open Pass,status =" << ret << endl;
}
//unsigned int patMode;
int numLutEntries = 0;
unsigned int status;
unsigned char splashLut[64];
int numSplashLutEntries = 0;
unsigned int numPatterns;
unsigned long int exposure_time;
int i = 0;
DLPC350_SetMode(true);
DLPC350_ClearPatLut();
numSplashLutEntries = 1;
numLutEntries = 22;
unsigned long int g_PatLut[MAX_PAT_LUT_ENTRIES] = { 0 };
unsigned int g_PatLutIndex = 0;
/*g_PatLut[0] = 0x67800;//每次取8位的深度
g_PatLut[1] = 0x67800;
g_PatLut[2] = 0x67800;
g_PatLut[3] = 0x67800;
g_PatLut[4] = 0x67800;
g_PatLut[5] = 0x67800;
g_PatLut[6] = 0x67800;
g_PatLut[7] = 0x67800;
g_PatLut[8] = 0x67800;
g_PatLut[9] = 0x67800;
g_PatLut[10] = 0x67800;
g_PatLut[11] = 0x67800;
g_PatLut[12] = 0x67800;
g_PatLut[13] = 0x67800;
g_PatLut[14] = 0x67800;
g_PatLut[15] = 0x67800;
g_PatLut[16] = 0x67800;
g_PatLut[17] = 0x67800;
g_PatLut[18] = 0x67800;
g_PatLut[19] = 0x67800;
g_PatLut[20] = 0x67800;
g_PatLut[21] = 0x67800;*/
g_PatLut[0] = 0x67100;//取一位深度时用
g_PatLut[1] = 0x27104;
g_PatLut[2] = 0x27108;
g_PatLut[3] = 0x2710c;
g_PatLut[4] = 0x27110;
g_PatLut[5] = 0x27114;
g_PatLut[6] = 0x27118;
g_PatLut[7] = 0x2711c;
g_PatLut[8] = 0x27120;
g_PatLut[9] = 0x27124;
g_PatLut[10] = 0x27128;
g_PatLut[11] = 0x2712c;
g_PatLut[12] = 0x27130;
g_PatLut[13] = 0x27134;
g_PatLut[14] = 0x27138;
g_PatLut[15] = 0x2713c;
g_PatLut[16] = 0x27140;
g_PatLut[17] = 0x27144;
g_PatLut[18] = 0x27148;
g_PatLut[19] = 0x2714c;
g_PatLut[20] = 0x27150;
g_PatLut[21] = 0x27154;
splashLut[0] = 0x0;//取一位深度时用
/*splashLut[1] = 0x1;//取8位深度时用
splashLut[2] = 0x2;
splashLut[3] = 0x3;
splashLut[4] = 0x4;
splashLut[5] = 0x5;
splashLut[6] = 0x6;
splashLut[7] = 0x7;
splashLut[8] = 0x8;
splashLut[9] = 0x9;
splashLut[10] = 0xA;
splashLut[11] = 0xb;
splashLut[12] = 0xc;
splashLut[13] = 0xd;
splashLut[14] = 0xe;
splashLut[15] = 0xf;
splashLut[16] = 0x10;
splashLut[17] = 0x11;
splashLut[18] = 0x12;
splashLut[19] = 0x13;
splashLut[20] = 0x14;
splashLut[21] = 0x15;*/
DLPC350_SetPatternDisplayMode(false);
numPatterns = 22;
DLPC350_SetPatternConfig(numLutEntries, false, numPatterns, numSplashLutEntries);
DLPC350_SetLongAxisImageFlip(false);
DLPC350_SetShortAxisImageFlip(true);
exposure_time = 1000000;
DLPC350_SetExposure_FramePeriod(exposure_time,exposure_time);
/*DLPC350_SetGPIOConfig(0,false,false,true,false,false);
DLPC350_SetPWMConfig(0,exposure_time,50);
DLPC350_SetPWMEnable(0,true);*/
//DLPC350_SetPatternTriggerMode(1);
DLPC350_SetTrigIn1Delay(1);
DLPC350_SetTrigOutConfig(1,false,187,187);
DLPC350_SetTrigOutConfig(2, false, 187, 187);
DLPC350_SetRedLEDStrobeDelay(187, 187);
DLPC350_SetGreenLEDStrobeDelay(187, 187);
DLPC350_SetBlueLEDStrobeDelay(187, 187);
g_PatLutIndex = 22;
DLPC350_SendPatLut();
DLPC350_SendImageLut(&splashLut[0], numSplashLutEntries);
// DLPC350_ValidatePatLutData(&status);
DLPC350_SetLedEnables(true, false, false, false);
DLPC350_SetLEDPWMInvert(false);
DLPC350_SetLedCurrents(10, 135, 130);
DLPC350_SetLedEnables(true, true, true, true);
bool ProjectControl = true;
while (ProjectControl)
{
DLPC350_ValidatePatLutData(&status);
DLPC350_PatternDisplay(2);
Sleep(exposure_time*g_PatLutIndex/1000 );//毫秒
cout << "投影结束,继续投影请输入1,否则输入0:" << endl;
cin >> ProjectControl;
}
system("pause");
return 0;