Moved to Team 9.
Fork of LineScan by
Diff: LineScan.cpp
- Revision:
- 9:5226617d2019
- Parent:
- 8:b9ec2f3e12b6
- Child:
- 10:6b6c3db74538
- Child:
- 11:5e66d0531053
--- a/LineScan.cpp Thu Apr 02 18:38:29 2015 +0000 +++ b/LineScan.cpp Fri Apr 03 00:27:53 2015 +0000 @@ -8,7 +8,7 @@ #define THRESH 10000 #define MEAN_REF 30000 //ideal difference we should see -#define CAM_CTRL_GAIN 0.001 //should be small +#define CAM_CTRL_GAIN 0.0005 //should be small uint16_t read1Bit(AnalogIn cam, DigitalOut *camClk){ uint16_t pixel; @@ -63,10 +63,10 @@ } exposureChange = ((float)(MEAN_REF - highest + lowest)) * CAM_CTRL_GAIN; //AGC, simple proportional controller *exposure += (int)exposureChange; - if(*exposure <= 0) - *exposure = 1; - else if(*exposure > 40) - *exposure = 40; + if(*exposure < 10) + *exposure = 10; + else if(*exposure > 30) + *exposure = 30; } return ((float)(h_idx + l_idx)) / (2.0 * (float)frameLen); //0 is center