-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsample.c
924 lines (729 loc) · 36.2 KB
/
sample.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
/*****************************************************************************
** TEXAS INSTRUMENTS PROPRIETARY INFORMATION
**
** (c) Copyright, Texas Instruments Incorporated, 2012-2013.
** All Rights Reserved.
**
** Property of Texas Instruments Incorporated. Restricted Rights -
** Use, duplication, or disclosure is subject to restrictions set
** forth in TI's program license agreement and associated documentation.
******************************************************************************/
/**
*
* @file main.c
*
* @brief This file contatins main() function from where the DM365 Command Interfaces
* can be called.
* This file also contain demo example functions which shows how the APIs can be
* called in sequence.
**/
/*****************************************************************************/
#include <unistd.h>
#include "common.h"
#include "error.h"
#include "lcr_cmd.h"
static void mSleep(unsigned long int mSeconds);
//Demo code show how the DM365 command interfaces can be called.
static void Demo_1_ReadLightCrafterVersion();
static void Demo_2_AdjustLEDCurrent();
static void Demo_3_StaticImageDownload();
static void Demo_4_DisplayModeChange();
static void Demo_5_1BppPatternSeqDemo();
static void Demo_6_8BppPatternSeqDemo();
static void Demo_7_InternalHWTestPatternModeDemo();
static void Demo_8_VariableBitDepthPatSeqDemo();
static void Demo_9_SolutionDemo();
/* main() function */
int main(int argc, char *argv[])
{
uint8 ch;
//Connect to the LCr H/W via TCP interface
if(LCR_CMD_Open())
{
printf("Unable to connect to the DLP LCr\n");
return -1;
}
printf("**********************************************************************************\n");
printf("Select '1' thru '9' to run a demo, Select '0' to run 'All' demo, and 'x' to 'exit'\n");
printf("**********************************************************************************\n");
printf("Demo#1 - Reading DLP LightCrafter Version information\n");
printf("Demo#2 - Test LED Currents\n");
printf("Demo#3 - Downloading 24bpp image\n");
printf("Demo#4 - Switching between Display modes - StaticImage/InternalTestPattern/ExternVideo/PatternSequence\n");
printf("Demo#5 - Configuring 1bpp pattern Sequence\n");
printf("Demo#6 - Configuring 8bpp pattern Sequence\n");
printf("Demo#7 - Run Internal Hardware test patterns\n");
printf("Demo#8 - Custom Sequence configuration\n");
printf("Demo#9 - Solution demo\n\n");
while((ch=getchar()) != 'x')
{
switch(ch)
{
case '1':
Demo_1_ReadLightCrafterVersion();
break;
case '2':
Demo_2_AdjustLEDCurrent();
break;
case '3':
Demo_3_StaticImageDownload();
break;
case '4':
Demo_4_DisplayModeChange();
break;
case '5':
Demo_5_1BppPatternSeqDemo();
break;
case '6':
Demo_6_8BppPatternSeqDemo();
break;
case '7':
Demo_7_InternalHWTestPatternModeDemo();
break;
case '8':
Demo_8_VariableBitDepthPatSeqDemo();
break;
case '9':
Demo_9_SolutionDemo();
break;
case '0':
Demo_1_ReadLightCrafterVersion();
Demo_2_AdjustLEDCurrent();
Demo_3_StaticImageDownload();
Demo_4_DisplayModeChange();
//Demo_5_1BppPatternSeqDemo(); This will be called in Demo_4_DisplayModeChange interface
Demo_6_8BppPatternSeqDemo();
Demo_7_InternalHWTestPatternModeDemo();
Demo_8_VariableBitDepthPatSeqDemo();
Demo_9_SolutionDemo();
break;
default:
break;
}
printf("**********************************************************************************\n");
printf("Select '1' thru '9' to run a demo, Select '0' to run 'All' demo, and 'x' to 'exit'\n");
printf("**********************************************************************************\n");
}
LCR_CMD_Close();
return 0;
}
/*Demo-1: How to read the LightCrafter Version */
static void Demo_1_ReadLightCrafterVersion()
{
char verName[LCR_CMD_VERSION_STR_LEN];
printf("\n\n****Running Demo #1 - Reading DLP LightCrafter(TM) Software version(s)****\n\n");
LCR_CMD_GetRevision(REV_DM365,&verName[0]);
printf("DM365 Revision: %s\n",verName);
LCR_CMD_GetRevision(REV_FPGA,&verName[0]);
printf("FPGA Revision: %s\n",verName);
LCR_CMD_GetRevision(REV_MSP430,&verName[0]);
printf("MSP430 Revision: %s\n",verName);
}
/*Demo-2: How to adjust LED currents */
static void Demo_2_AdjustLEDCurrent()
{
//Test for LED current update
LCR_LEDCurrent_t LEDSetting;
LCR_LEDCurrent_t tempLEDSetting;
printf("\n\n****Running Demo #2 - Adjusting LED Currents****\n\n");
if(LCR_CMD_GetLEDCurrent(&LEDSetting))
{
printf("Couldn't read the LED Current setting\n");
}
else
{
printf("Existing LED Current setting Red = %d\tGreen = %d\tBlue = %d\n",LEDSetting.Red,LEDSetting.Green,LEDSetting.Blue);
printf("Set MIN 0x00 LED setting\n");
tempLEDSetting.Red = 0;
tempLEDSetting.Green = 0;
tempLEDSetting.Blue = 0;
if(LCR_CMD_SetLEDCurrent(&tempLEDSetting))
{
printf("Couldn't set the LED Currents\n");
}
else
{
mSleep(3000);
printf("Set MAX 0x3FF LED setting\n");
tempLEDSetting.Red = 0x3FF;
tempLEDSetting.Green = 0x3FF;
tempLEDSetting.Blue = 0x3FF;
if(LCR_CMD_SetLEDCurrent(&tempLEDSetting))
{
printf("Couldn't set the LED Currents\n");
}
else
{
mSleep(3000);
printf("Set default values of LED setting\n");
LCR_CMD_SetLEDCurrent(&LEDSetting);
}
}
}
}
/* Demo-3: How to download a 24bpp static image */
static void Demo_3_StaticImageDownload()
{
printf("\n\n****Running Demo #3 - Downloading 24bpp static image****\n\n");
//Set display mode to 0x00 - static image
LCR_CMD_SetDisplayMode((LCR_DisplayMode_t)(0x00));
printf("Downloading RGB888 Color Ramp Image \n");
LCR_CMD_DisplayStaticImage("./Images/StaticImages/Color_RGB888.bmp");
mSleep(3000);
printf("Downloading LightCrafter image\n");
LCR_CMD_DisplayStaticImage("./Images/StaticImages/LightCrafter.bmp");
mSleep(3000);
printf("Downloading Mangrove\n");
LCR_CMD_DisplayStaticImage("./Images/StaticImages/Mangrove.bmp");
mSleep(3000);
printf("Displaying static pleasing color...\n");
uint32 color;
color = 0x00FFFFFF;
LCR_CMD_DisplayStaticColor(color);
mSleep(3000);
printf("Downloading RGB888 ramp again...\n");
LCR_CMD_DisplayStaticImage("./Images/StaticImages/Color_RGB888.bmp");
}
/* Demo-4: Cycle through Display Modes */
static void Demo_4_DisplayModeChange()
{
printf("\n\n****Running Demo #4 - Display Mode changine****\n\n");
LCR_DisplayMode_t Mode;
Mode = LCR_CMD_GetDisplayMode();
printf("Default display Mode: %d\n",Mode);
printf("Setting Display Mode = Static Image\n");
LCR_CMD_SetDisplayMode((LCR_DisplayMode_t)(0x00));
mSleep(3000);
printf("Setting Display Mode = Internal Test Pattern\n");
LCR_CMD_SetDisplayMode((LCR_DisplayMode_t)(0x01));
mSleep(3000);
printf("Setting Display Mode = HDMI Video, if HDMI is connected to a source you will get video\n");
LCR_CMD_SetDisplayMode((LCR_DisplayMode_t)(0x02));
mSleep(3000);
printf("Setting Display Mode = Pattern Seq Mode\n");
Demo_5_1BppPatternSeqDemo();
}
/* Demo-5: Pattern Sequence Demo (1BPP) */
static void Demo_5_1BppPatternSeqDemo()
{
uint8 i;
LCR_PatternSeqSetting_t patSeqSet;
printf("\n\n****Running Demo #5 - 1bpp Pattern Sequence ****\n\n");
LCR_CMD_SetDisplayMode((LCR_DisplayMode_t)(0x04));
printf("Selecting BIT_DEPTH = 1, NUM_PAT = 8, TRIGGER_TYPE = AUTO, AUTO_TRIG_PEIORD = 33334uSec, EXPOSURE = 33334uSec, LED = GREEN\n");
patSeqSet.BitDepth = 1;
patSeqSet.NumPatterns = 8;
patSeqSet.PatternType = PTN_TYPE_NORMAL;
patSeqSet.InputTriggerDelay = 0;
patSeqSet.InputTriggerType = TRIGGER_TYPE_AUTO;
patSeqSet.AutoTriggerPeriod = 33334;
patSeqSet.ExposureTime = 33334;
patSeqSet.LEDSelect = LED_GREEN;
patSeqSet.Repeat = 0;
LCR_CMD_SetPatternSeqSetting(&patSeqSet);
printf("Downloading pat0\n");
LCR_CMD_DefinePatternBMP(0,"./Images/PatSeqImages/pattern_1_00.bmp");
printf("Downloading pat1...\n");
LCR_CMD_DefinePatternBMP(1,"./Images/PatSeqImages/pattern_1_01.bmp");
printf("Downloading pat2...\n");
LCR_CMD_DefinePatternBMP(2,"./Images/PatSeqImages/pattern_1_02.bmp");
printf("Downloading pat3...\n");
LCR_CMD_DefinePatternBMP(3,"./Images/PatSeqImages/pattern_1_03.bmp");
printf("Downloading pat4...\n");
LCR_CMD_DefinePatternBMP(4,"./Images/PatSeqImages/pattern_1_04.bmp");
printf("Downloading pat5...\n");
LCR_CMD_DefinePatternBMP(5,"./Images/PatSeqImages/pattern_1_05.bmp");
printf("Downloading pat6...\n");
LCR_CMD_DefinePatternBMP(6,"./Images/PatSeqImages/pattern_1_06.bmp");
printf("Downloading pat7...\n");
LCR_CMD_DefinePatternBMP(7,"./Images/PatSeqImages/pattern_1_07.bmp");
printf("Starting Pattern Sequence...\n");
LCR_CMD_StartPatternSeq(1);
mSleep(10000);
LCR_CMD_StartPatternSeq(0); //Stop pattern sequence
printf("Changing Exposure Time and Trigger time AUTO_TRIG_PEIORD = 250uSec, EXPOSURE = 250uSec LED = RED\n");
LCR_CMD_GetPatternSeqSetting(&patSeqSet);
patSeqSet.AutoTriggerPeriod = 250; //250uSec
patSeqSet.ExposureTime = 250; //250uSec
patSeqSet.LEDSelect = LED_RED;
LCR_CMD_SetPatternSeqSetting(&patSeqSet);
printf("Starting Pattern Sequence...\n");
LCR_CMD_StartPatternSeq(1);
mSleep(10000);
printf("Changing Auto Trigger -> SW Trigger Mode\n");
printf("Changing Exposure Time and Trigger time AUTO_TRIG_PEIORD = 1000000uSec, EXPOSURE = 1000000uSec LED = BLUE\n");
LCR_CMD_GetPatternSeqSetting(&patSeqSet);
patSeqSet.AutoTriggerPeriod = 1000000;
patSeqSet.ExposureTime = 1000000;
patSeqSet.LEDSelect = LED_BLUE;
patSeqSet.InputTriggerType = TRIGGER_TYPE_SW;//Change input trigger to SW
LCR_CMD_SetPatternSeqSetting(&patSeqSet);
printf("Starting Pattern Sequence...\n");
LCR_CMD_StartPatternSeq(1);
i = 8;
while(i--)
{
LCR_CMD_AdvancePatternSeq();
mSleep(1000); //wait for 1Second
}
LCR_CMD_SetDisplayMode((LCR_DisplayMode_t)(0x00)); //Setting back to static display mode
}
/* Demo-6: Pattern Sequence Demo (1BPP) */
static void Demo_6_8BppPatternSeqDemo()
{
uint8 i;
LCR_PatternSeqSetting_t patSeqSet;
printf("\n\n****Running Demo #6 - 8bpp Pattern Sequence ****\n\n");
LCR_CMD_SetDisplayMode((LCR_DisplayMode_t)(0x04));
printf("Selecting BIT_DEPTH = 8, NUM_PAT = 3, TRIGGER_TYPE = AUTO, AUTO_TRIG_PEIORD = 8700uSec, EXPOSURE = 8333, LED = BLUE\n");
patSeqSet.BitDepth = 8;
patSeqSet.NumPatterns = 3;
patSeqSet.PatternType = PTN_TYPE_NORMAL;
patSeqSet.InputTriggerType = TRIGGER_TYPE_AUTO;
patSeqSet.InputTriggerDelay = 0;
patSeqSet.AutoTriggerPeriod = 8700;
patSeqSet.ExposureTime = 8333;
patSeqSet.LEDSelect = LED_BLUE;
patSeqSet.Repeat = 0;
LCR_CMD_SetPatternSeqSetting(&patSeqSet);
printf("Downloading pat0\n");
LCR_CMD_DefinePatternBMP(0,"./Images/PatSeqImages/pattern_8_00.bmp");
printf("Downloading pat1...\n");
LCR_CMD_DefinePatternBMP(1,"./Images/PatSeqImages/pattern_8_01.bmp");
printf("Downloading pat2...\n");
LCR_CMD_DefinePatternBMP(2,"./Images/PatSeqImages/pattern_8_02.bmp");
printf("Starting Pattern Sequence...\n");
LCR_CMD_StartPatternSeq(1);
mSleep(10000);
LCR_CMD_StartPatternSeq(0); //Stop pattern sequence
printf("Changing Exposure Time and Trigger time AUTO_TRIG_PEIORD = 10000uSec, EXPOSURE = 10000uSec LED = GREEN\n");
LCR_CMD_GetPatternSeqSetting(&patSeqSet);
patSeqSet.AutoTriggerPeriod = 10000; //uSec
patSeqSet.ExposureTime = 10000; //uSec
patSeqSet.LEDSelect = LED_GREEN;
LCR_CMD_SetPatternSeqSetting(&patSeqSet);
printf("Starting Pattern Sequence...\n");
LCR_CMD_StartPatternSeq(1);
mSleep(10000);
LCR_CMD_StartPatternSeq(0);
printf("Changing Auto Trigger -> SW Trigger Mode\n");
printf("Changing Exposure Time and Trigger time AUTO_TRIG_PEIORD = 20000uSec, EXPOSURE = 20000uSec LED = RED\n");
LCR_CMD_GetPatternSeqSetting(&patSeqSet);
patSeqSet.AutoTriggerPeriod = 20000;
patSeqSet.ExposureTime = 20000;
patSeqSet.InputTriggerType = TRIGGER_TYPE_SW;//Change input trigger to SW
LCR_CMD_SetPatternSeqSetting(&patSeqSet);
printf("Starting Pattern Sequence...\n");
LCR_CMD_StartPatternSeq(1);
i = 3;
while(i--)
{
LCR_CMD_AdvancePatternSeq();
mSleep(1000);
}
LCR_CMD_SetDisplayMode((LCR_DisplayMode_t)(0x00)); //Setting back to static display mode
}
/* Demo-7: Internal HW Pattern Sequence Demo (1BPP)*/
static void Demo_7_InternalHWTestPatternModeDemo()
{
uint8 i;
LCR_PatternSeqSetting_t patSeqSet;
printf("\n\n****Running Demo #7 - Internal 1bpp HW Pattern Sequence ****\n\n");
LCR_CMD_SetDisplayMode((LCR_DisplayMode_t)(0x04));
printf("Selecting BIT_DEPTH = 1, NUM_PAT = 32, TRIGGER_TYPE = AUTO, AUTO_TRIG_PEIORD = 16667uSec, EXPOSURE = 16667uSec, LED = BLUE\n");
patSeqSet.BitDepth = 1;
patSeqSet.NumPatterns = 32;
patSeqSet.PatternType = PTN_TYPE_HW;
patSeqSet.InputTriggerType = TRIGGER_TYPE_AUTO;
patSeqSet.InputTriggerDelay = 0;
patSeqSet.AutoTriggerPeriod = 16667;
patSeqSet.ExposureTime = 16667;
patSeqSet.LEDSelect = LED_BLUE;
patSeqSet.Repeat = 0;
LCR_CMD_SetPatternSeqSetting(&patSeqSet);
//Define Hardware Patterns
LCR_HWPatternSeqDef_t hwPatDef;
hwPatDef.index = 0;
hwPatDef.numOfPatn = 32;
//First Sequence without invert
for(i=0; i<hwPatDef.numOfPatn/2;i++)
{
hwPatDef.hwPatArray[i].Number = i;
hwPatDef.hwPatArray[i].Invert = 0;
}
//2nd sequence with invert
for( i=16; i<hwPatDef.numOfPatn;i++)
{
hwPatDef.hwPatArray[i].Number = (i-16);
hwPatDef.hwPatArray[i].Invert = 1;
}
LCR_CMD_DefineHWPatSequence(&hwPatDef);
printf("Starting Pattern Sequence...\n");
LCR_CMD_StartPatternSeq(1);
mSleep(10000);
LCR_CMD_StartPatternSeq(0); //Stop pattern sequence
printf("Changing Exposure Time and Trigger time AUTO_TRIG_PEIORD = 100000uSec, EXPOSURE = 100000uSec LED = RED...\n");
LCR_CMD_GetPatternSeqSetting(&patSeqSet);
patSeqSet.AutoTriggerPeriod = 100000; //uSec
patSeqSet.ExposureTime = 100000; //uSec
patSeqSet.LEDSelect = LED_RED;
LCR_CMD_SetPatternSeqSetting(&patSeqSet);
printf("Starting Pattern Sequence...\n");
LCR_CMD_StartPatternSeq(1);
mSleep(10000);
LCR_CMD_StartPatternSeq(0); //Stop pattern sequence
printf("Changing Auto Trigger -> SW Trigger Mode\n");
LCR_CMD_GetPatternSeqSetting(&patSeqSet);
printf("Changing Exposure Time and Trigger time AUTO_TRIG_PEIORD = 1000000uSec, EXPOSURE = 1000000uSec LED = GREEN...\n");
patSeqSet.AutoTriggerPeriod = 1000000; //uSec
patSeqSet.ExposureTime = 1000000; //uSec
patSeqSet.InputTriggerType = TRIGGER_TYPE_SW;//Change input trigger to SW
patSeqSet.LEDSelect = LED_GREEN;
LCR_CMD_SetPatternSeqSetting(&patSeqSet);
printf("Starting Pattern Sequence...\n");
LCR_CMD_StartPatternSeq(1);
i = 32;
while(i--)
{
LCR_CMD_AdvancePatternSeq();
mSleep(1000);
}
LCR_CMD_SetDisplayMode((LCR_DisplayMode_t)(0x00)); //Setting back to static display mode
}
/*Demo-8: Demostrates how to configure hardware for running custom sequence. */
static void Demo_8_VariableBitDepthPatSeqDemo()
{
//Create a 1bpp pat sequence and store it as a solution
LCR_PatternSeqSetting_t patSeqSet;
printf("\n\n****Running Demo #8 - Running custom sequence ****\n\n");
//Refer to ../Images/CustSeqInput/SingleColor/22Mar2013_12_17_PM_Readme.txt for details
printf(">>>>>>>Running Variable bit-depth pattern sequence with GREEN color<<<<<<<\n");
LCR_CMD_SetDisplayMode((LCR_DisplayMode_t)(0x04));
LCR_CMD_GetPatternSeqSetting(&patSeqSet);
patSeqSet.BitDepth = 1;
patSeqSet.NumPatterns = 48;
patSeqSet.PatternType = PTN_TYPE_NORMAL;
patSeqSet.InputTriggerDelay = 0;
patSeqSet.InputTriggerType = TRIGGER_TYPE_AUTO;
patSeqSet.AutoTriggerPeriod = 8333;
patSeqSet.ExposureTime = 8842;
patSeqSet.LEDSelect = LED_DEFAULT; //For configuring custom sequence the value must be set to default
LCR_CMD_SetPatternSeqSetting(&patSeqSet);
//Load the custom sequence and set the vector table
printf("Loading custom sequence ./Images/CustSeqInput/SingleColor/22Mar2013_12_17_PM.bin\n");
LCR_CMD_LoadCustomSequence("./Images/CustSeqInput/SingleColor/22Mar2013_12_17_PM.bin");
uint8 startvector = 0;
uint8 numOfvectors = 10;
printf("Setting up Start and Number of vectors\n");
LCR_CMD_SetupCustomSequencevectors(startvector,numOfvectors);
//Load the 48 1bpp images that are generated after splitting the patterns
printf("Downloading 48 1bpp images that are generated after splitting the patterns \n");
printf("Downloading ./Images/CustSeqInput/SingleColor/00_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(0,"./Images/CustSeqInput/SingleColor/00_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/01_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(1,"./Images/CustSeqInput/SingleColor/01_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/02_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(2,"./Images/CustSeqInput/SingleColor/02_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/03_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(3,"./Images/CustSeqInput/SingleColor/03_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/04_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(4,"./Images/CustSeqInput/SingleColor/04_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/05_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(5,"./Images/CustSeqInput/SingleColor/05_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/06_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(6,"./Images/CustSeqInput/SingleColor/06_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/07_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(7,"./Images/CustSeqInput/SingleColor/07_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/08_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(8,"./Images/CustSeqInput/SingleColor/08_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/09_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(9,"./Images/CustSeqInput/SingleColor/09_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/10_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(10,"./Images/CustSeqInput/SingleColor/10_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/11_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(11,"./Images/CustSeqInput/SingleColor/11_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/12_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(12,"./Images/CustSeqInput/SingleColor/12_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/13_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(13,"./Images/CustSeqInput/SingleColor/13_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/14_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(14,"./Images/CustSeqInput/SingleColor/14_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/15_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(15,"./Images/CustSeqInput/SingleColor/15_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/16_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(16,"./Images/CustSeqInput/SingleColor/16_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/17_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(17,"./Images/CustSeqInput/SingleColor/17_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/18_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(18,"./Images/CustSeqInput/SingleColor/18_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/19_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(19,"./Images/CustSeqInput/SingleColor/19_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/20_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(20,"./Images/CustSeqInput/SingleColor/20_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/21_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(21,"./Images/CustSeqInput/SingleColor/21_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/22_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(22,"./Images/CustSeqInput/SingleColor/22_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/23_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(23,"./Images/CustSeqInput/SingleColor/23_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/24_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(24,"./Images/CustSeqInput/SingleColor/24_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/25_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(25,"./Images/CustSeqInput/SingleColor/25_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/26_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(26,"./Images/CustSeqInput/SingleColor/26_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/27_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(27,"./Images/CustSeqInput/SingleColor/27_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/28_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(28,"./Images/CustSeqInput/SingleColor/28_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/29_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(29,"./Images/CustSeqInput/SingleColor/29_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/30_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(30,"./Images/CustSeqInput/SingleColor/30_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/31_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(31,"./Images/CustSeqInput/SingleColor/31_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/32_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(32,"./Images/CustSeqInput/SingleColor/32_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/33_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(33,"./Images/CustSeqInput/SingleColor/33_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/34_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(34,"./Images/CustSeqInput/SingleColor/34_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/35_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(35,"./Images/CustSeqInput/SingleColor/35_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/36_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(36,"./Images/CustSeqInput/SingleColor/36_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/37_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(37,"./Images/CustSeqInput/SingleColor/37_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/38_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(38,"./Images/CustSeqInput/SingleColor/38_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/39_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(39,"./Images/CustSeqInput/SingleColor/39_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/40_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(40,"./Images/CustSeqInput/SingleColor/40_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/41_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(41,"./Images/CustSeqInput/SingleColor/41_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/42_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(42,"./Images/CustSeqInput/SingleColor/42_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/43_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(43,"./Images/CustSeqInput/SingleColor/43_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/44_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(44,"./Images/CustSeqInput/SingleColor/44_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/45_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(45,"./Images/CustSeqInput/SingleColor/45_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/46_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(46,"./Images/CustSeqInput/SingleColor/46_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/SingleColor/47_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(47,"./Images/CustSeqInput/SingleColor/47_PAT.bmp");
printf("Starting the sequence\n");
LCR_CMD_StartPatternSeq(1);
mSleep(10000);
printf("Stoping the sequence\n");
//Refer to ..\Images\CustSeqInput\MultiColor\22Mar2013_12_18_PM_Readme.txt for details
printf("\n>>>>>>>Running Variable bit-depth pattern sequence with individual pattern color selection color<<<<<<<\n");
LCR_CMD_SetDisplayMode((LCR_DisplayMode_t)(0x04));
LCR_CMD_GetPatternSeqSetting(&patSeqSet);
patSeqSet.BitDepth = 1;
patSeqSet.NumPatterns = 48;
patSeqSet.PatternType = PTN_TYPE_NORMAL;
patSeqSet.InputTriggerDelay = 0;
patSeqSet.InputTriggerType = TRIGGER_TYPE_AUTO;
patSeqSet.AutoTriggerPeriod = 20000;
patSeqSet.ExposureTime = 20360;
patSeqSet.LEDSelect = LED_DEFAULT; //For configuring custom sequence the value must be set to default
LCR_CMD_SetPatternSeqSetting(&patSeqSet);
//Load the custom sequence and set the vector table
printf("Loading custom sequence ../Images/CustSeqInput/MultiColor/22Mar2013_12_18_PM.bin\n");
LCR_CMD_LoadCustomSequence("./Images/CustSeqInput/MultiColor/22Mar2013_12_18_PM.bin");
startvector = 0;
numOfvectors = 10;
printf("Setting up Start and Number of vectors\n");
LCR_CMD_SetupCustomSequencevectors(startvector,numOfvectors);
//Load the 48 1bpp images that are generated after splitting the patterns
printf("Downloading 48 1bpp images that are generated after splitting the patterns \n");
printf("Downloading ./Images/CustSeqInput/MultiColor/00_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(0,"./Images/CustSeqInput/MultiColor/00_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/01_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(1,"./Images/CustSeqInput/MultiColor/01_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/02_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(2,"./Images/CustSeqInput/MultiColor/02_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/03_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(3,"./Images/CustSeqInput/MultiColor/03_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/04_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(4,"./Images/CustSeqInput/MultiColor/04_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/05_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(5,"./Images/CustSeqInput/MultiColor/05_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/06_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(6,"./Images/CustSeqInput/MultiColor/06_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/07_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(7,"./Images/CustSeqInput/MultiColor/07_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/08_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(8,"./Images/CustSeqInput/MultiColor/08_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/09_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(9,"./Images/CustSeqInput/MultiColor/09_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/10_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(10,"./Images/CustSeqInput/MultiColor/10_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/11_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(11,"./Images/CustSeqInput/MultiColor/11_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/12_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(12,"./Images/CustSeqInput/MultiColor/12_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/13_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(13,"./Images/CustSeqInput/MultiColor/13_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/14_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(14,"./Images/CustSeqInput/MultiColor/14_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/15_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(15,"./Images/CustSeqInput/MultiColor/15_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/16_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(16,"./Images/CustSeqInput/MultiColor/16_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/17_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(17,"./Images/CustSeqInput/MultiColor/17_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/18_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(18,"./Images/CustSeqInput/MultiColor/18_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/19_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(19,"./Images/CustSeqInput/MultiColor/19_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/20_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(20,"./Images/CustSeqInput/MultiColor/20_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/21_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(21,"./Images/CustSeqInput/MultiColor/21_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/22_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(22,"./Images/CustSeqInput/MultiColor/22_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/23_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(23,"./Images/CustSeqInput/MultiColor/23_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/24_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(24,"./Images/CustSeqInput/MultiColor/24_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/25_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(25,"./Images/CustSeqInput/MultiColor/25_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/26_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(26,"./Images/CustSeqInput/MultiColor/26_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/27_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(27,"./Images/CustSeqInput/MultiColor/27_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/28_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(28,"./Images/CustSeqInput/MultiColor/28_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/29_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(29,"./Images/CustSeqInput/MultiColor/29_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/30_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(30,"./Images/CustSeqInput/MultiColor/30_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/31_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(31,"./Images/CustSeqInput/MultiColor/31_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/32_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(32,"./Images/CustSeqInput/MultiColor/32_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/33_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(33,"./Images/CustSeqInput/MultiColor/33_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/34_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(34,"./Images/CustSeqInput/MultiColor/34_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/35_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(35,"./Images/CustSeqInput/MultiColor/35_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/36_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(36,"./Images/CustSeqInput/MultiColor/36_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/37_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(37,"./Images/CustSeqInput/MultiColor/37_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/38_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(38,"./Images/CustSeqInput/MultiColor/38_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/39_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(39,"./Images/CustSeqInput/MultiColor/39_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/40_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(40,"./Images/CustSeqInput/MultiColor/40_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/41_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(41,"./Images/CustSeqInput/MultiColor/41_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/42_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(42,"./Images/CustSeqInput/MultiColor/42_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/43_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(43,"./Images/CustSeqInput/MultiColor/43_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/44_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(44,"./Images/CustSeqInput/MultiColor/44_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/45_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(45,"./Images/CustSeqInput/MultiColor/45_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/46_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(46,"./Images/CustSeqInput/MultiColor/46_PAT.bmp");
printf("Downloading ./Images/CustSeqInput/MultiColor/47_PAT.bmp\n");
LCR_CMD_DefinePatternBMP(47,"./Images/CustSeqInput/MultiColor/47_PAT.bmp");
printf("Starting the sequence\n");
LCR_CMD_StartPatternSeq(1);
mSleep(10000);
printf("Stoping the sequence\n");
LCR_CMD_SetDisplayMode((LCR_DisplayMode_t)(0x00)); //Setting back to static display mode
}
/* Demo-9: Demonstrated saving, loading and deleting a solution */
static void Demo_9_SolutionDemo()
{
//Create a 1bpp pat sequence and store it as a solution
LCR_PatternSeqSetting_t patSeqSet;
printf("\n\n****Running Demo #9 - Solution Load, Save and Delete ****\n\n");
printf("Configuring 2bpp pattern sequence mode...\n");
LCR_CMD_SetDisplayMode((LCR_DisplayMode_t)(0x04));
LCR_CMD_GetPatternSeqSetting(&patSeqSet);
patSeqSet.BitDepth = 2;
patSeqSet.NumPatterns = 4;
patSeqSet.PatternType = PTN_TYPE_NORMAL;
patSeqSet.InputTriggerDelay = 0;
patSeqSet.InputTriggerType = TRIGGER_TYPE_AUTO;
patSeqSet.AutoTriggerPeriod = 10000;
patSeqSet.ExposureTime = 10000;
patSeqSet.LEDSelect = LED_RED; //Red LED
LCR_CMD_SetPatternSeqSetting(&patSeqSet);
LCR_CMD_DefinePatternBMP(0,"./Images/PatSeqImages/pattern_2_00.bmp");
LCR_CMD_DefinePatternBMP(1,"./Images/PatSeqImages/pattern_2_01.bmp");
LCR_CMD_DefinePatternBMP(2,"./Images/PatSeqImages/pattern_2_02.bmp");
LCR_CMD_DefinePatternBMP(3,"./Images/PatSeqImages/pattern_2_03.bmp");
LCR_CMD_StartPatternSeq(1);
//Saving this configuration as solution-1
printf("Saving it as \"SOLUTION_1\"...\n");
LCR_CMD_SaveSolution("SOLUTION_1");
LCR_CMD_StartPatternSeq(0);
printf("Configuring 7bpp pattern sequence mode...\n");
LCR_CMD_SetDisplayMode((LCR_DisplayMode_t)(0x04));
LCR_CMD_GetPatternSeqSetting(&patSeqSet);
patSeqSet.BitDepth = 7;
patSeqSet.NumPatterns = 3;
patSeqSet.PatternType = PTN_TYPE_NORMAL;
patSeqSet.InputTriggerDelay = 0;
patSeqSet.InputTriggerType = TRIGGER_TYPE_AUTO;
patSeqSet.AutoTriggerPeriod = 15000;
patSeqSet.ExposureTime = 15000;
patSeqSet.LEDSelect = LED_GREEN; //Green LED
LCR_CMD_SetPatternSeqSetting(&patSeqSet);
LCR_CMD_DefinePatternBMP(0,"./Images/PatSeqImages/pattern_7_00.bmp");
LCR_CMD_DefinePatternBMP(1,"./Images/PatSeqImages/pattern_7_01.bmp");
LCR_CMD_DefinePatternBMP(2,"./Images/PatSeqImages/pattern_7_02.bmp");
LCR_CMD_StartPatternSeq(1);
//Saving this configuration as solution-2
printf("Saving it as \"SOLUTION_2\"...\n");
LCR_CMD_SaveSolution("SOLUTION_2");
printf("Switching to static display mode\n");
LCR_CMD_SetDisplayMode((LCR_DisplayMode_t)(0x00));
mSleep(5000);
printf("Switching to SOLUTION_1...\n");
LCR_CMD_ManageSolution(SOL_LOAD, "SOLUTION_1");
LCR_CMD_StartPatternSeq(1);
mSleep(5000);
printf("Switching to SOLUTION_2...\n");
LCR_CMD_ManageSolution(SOL_LOAD, "SOLUTION_2");
LCR_CMD_StartPatternSeq(1);
mSleep(5000);
printf("Switching back to SOLUTION_1...\n");
LCR_CMD_ManageSolution(SOL_LOAD, "SOLUTION_2");
LCR_CMD_StartPatternSeq(1);
mSleep(5000);
printf("Printing stored solutions names in the LightCrafter\n");
uint8 Count;
uint8 DefaultSolution;
char SolutionName[LCR_CMD_SOLUTION_NAME_LEN*255];
LCR_CMD_GetSolutionNames(&Count, &DefaultSolution, &SolutionName[0]);
int i = 0;
while(i<(Count*LCR_CMD_SOLUTION_NAME_LEN))
{
putchar(SolutionName[i]);
i++;
}
printf("\n");
printf("Deleting solutions SOLUTION_1 & SOLUTION_2\n");
LCR_CMD_ManageSolution(SOL_DELETE,"SOLUTION_1");
LCR_CMD_ManageSolution(SOL_DELETE,"SOLUTION_2");
LCR_CMD_SetDisplayMode((LCR_DisplayMode_t)(0x00)); //Setting back to static display mode
}
/*Function is used to create delay in mSeconds */
/* This is used in demo code to show code flow */
static void mSleep(unsigned long int mSeconds)
{
/*Add logic and call system function that will create mSeconds millisecond delay */
sleep((mSeconds/1000.0));
}