
Median filtered & triggered + buffered RGB readings
Dependencies: mbed rgb_sensor_buffer
Revision 4:a4538586c75e, committed 2014-07-03
- Comitter:
- meriac
- Date:
- Thu Jul 03 17:57:52 2014 +0000
- Parent:
- 3:a4e4f4414533
- Child:
- 5:91ca771eff16
- Commit message:
- Reformatted
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Jul 03 17:55:01 2014 +0000 +++ b/main.cpp Thu Jul 03 17:57:52 2014 +0000 @@ -103,7 +103,11 @@ /* calculate RGB median */ median(color, res); /* print normalized median */ - magnitude = sqrt((((double)color.ch.red*color.ch.red)+((double)color.ch.green*color.ch.green)+((double)color.ch.blue*color.ch.blue))); + magnitude = sqrt( + ( (double)color.ch.red * color.ch.red )+ + ( (double)color.ch.green * color.ch.green )+ + ( (double)color.ch.blue * color.ch.blue ) + ); console.printf("\t[%1.4f,%1.4f,%1.4f,%5i], // %i values in %ims (%i/s)\n\r", color.ch.red / magnitude, color.ch.green / magnitude,