Skip to content

Commit

Permalink
Updated documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
nthnn committed Aug 3, 2023
1 parent 111421d commit d70fdf2
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 172 deletions.
33 changes: 13 additions & 20 deletions docs/d5/d33/example.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@
<li class="level1"><a href="#autotoc_md19">Integration in the Loop</a></li>
</ul>
</div>
<div class="textblock"><p>This page contains the comprehensive list of examples and usage of <a class="el" href="../../d5/d46/class_t_c_s3200.html" title="Class representing the TCS3200 color sensor.">TCS3200</a> Arduino library.</p>
<div class="textblock"><p>This page contains the comprehensive list of examples and usage of TCS3200 Arduino library.</p>
<h1><a class="anchor" id="autotoc_md11"></a>
Setup and Initialization</h1>
<p>To use the TCS3200 Arduino Library, include the "tcs3200.h" header file and create an instance of the <a class="el" href="../../d5/d46/class_t_c_s3200.html" title="Class representing the TCS3200 color sensor.">TCS3200</a> class. Use the <code>begin()</code> function to initialize the TCS3200 sensor, configure pins, and set default integration time and frequency scaling.</p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="../../d5/dac/_t_c_s3200_8h.html">tcs3200.h</a>&quot;</span></div>
<p>To use the TCS3200 Arduino Library, include the "tcs3200.h" header file and create an instance of the TCS3200 class. Use the <code>begin()</code> function to initialize the TCS3200 sensor, configure pins, and set default integration time and frequency scaling.</p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;tcs3200.h&quot;</span></div>
<div class="line"> </div>
<div class="line"><span class="comment">// Pin assignments for S0, S1, S2, S3, and OUT pins</span></div>
<div class="line"><span class="preprocessor">#define S0_PIN 2</span></div>
Expand All @@ -127,14 +127,12 @@ <h1><a class="anchor" id="autotoc_md11"></a>
<div class="line"><span class="preprocessor">#define OUT_PIN 6</span></div>
<div class="line"> </div>
<div class="line"><span class="comment">// Create an instance of TCS3200</span></div>
<div class="line"><a class="code hl_class" href="../../d5/d46/class_t_c_s3200.html">TCS3200</a> colorSensor(S0_PIN, S1_PIN, S2_PIN, S3_PIN, OUT_PIN);</div>
<div class="line">TCS3200 colorSensor(S0_PIN, S1_PIN, S2_PIN, S3_PIN, OUT_PIN);</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">void</span> setup() {</div>
<div class="line"> <span class="comment">// Initialize the sensor</span></div>
<div class="line"> colorSensor.begin();</div>
<div class="line">}</div>
<div class="ttc" id="a_t_c_s3200_8h_html"><div class="ttname"><a href="../../d5/dac/_t_c_s3200_8h.html">TCS3200.h</a></div><div class="ttdoc">TCS3200 Color Sensor Arduino Library</div></div>
<div class="ttc" id="aclass_t_c_s3200_html"><div class="ttname"><a href="../../d5/d46/class_t_c_s3200.html">TCS3200</a></div><div class="ttdoc">Class representing the TCS3200 color sensor.</div><div class="ttdef"><b>Definition</b> TCS3200.h:219</div></div>
</div><!-- fragment --><h1><a class="anchor" id="autotoc_md12"></a>
Calibration</h1>
<p>The TCS3200 sensor requires calibration for accurate color sensing. Calibration involves capturing readings for both the lightest and darkest colors to establish the range for color intensity mapping. Use the <code>calibrate()</code> function to enable calibration mode, and after invoking <code>calibrate_light()</code> and <code>calibrate_dark()</code> functions to calibrate the sensor with white and black reference colors, respectively.</p>
Expand Down Expand Up @@ -163,9 +161,8 @@ <h1><a class="anchor" id="autotoc_md11"></a>
<div class="line"> uint8_t clearIntensity = colorSensor.read_clear();</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// Or read RGB color intensity values as an RGBColor structure</span></div>
<div class="line"> <a class="code hl_struct" href="../../d0/d8a/struct___r_g_b_color.html">RGBColor</a> color = colorSensor.read_rgb_color();</div>
<div class="line"> RGBColor color = colorSensor.read_rgb_color();</div>
<div class="line">}</div>
<div class="ttc" id="astruct___r_g_b_color_html"><div class="ttname"><a href="../../d0/d8a/struct___r_g_b_color.html">_RGBColor</a></div><div class="ttdoc">Structure to represent RGB color values.</div><div class="ttdef"><b>Definition</b> TCS3200.h:167</div></div>
</div><!-- fragment --><h1><a class="anchor" id="autotoc_md14"></a>
Integration Time and Frequency Scaling</h1>
<p>The library provides control over the integration time and frequency scaling of the TCS3200 sensor. Integration time is set using the <code>integration_time()</code> function, and frequency scaling is set using the <code>frequency_scaling()</code> function. Integration time affects the accuracy and sensitivity of color measurements, while frequency scaling optimizes the trade-off between accuracy and response time.</p>
Expand All @@ -177,9 +174,8 @@ <h1><a class="anchor" id="autotoc_md11"></a>
<div class="line"> colorSensor.integration_time(2500);</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// Set frequency scaling to 20%</span></div>
<div class="line"> colorSensor.frequency_scaling(<a class="code hl_define" href="../../d5/dac/_t_c_s3200_8h.html#a7c17ec4eb2e59a7c01f8ec0c1ac5656e">TCS3200_OFREQ_20P</a>);</div>
<div class="line"> colorSensor.frequency_scaling(TCS3200_OFREQ_20P);</div>
<div class="line">}</div>
<div class="ttc" id="a_t_c_s3200_8h_html_a7c17ec4eb2e59a7c01f8ec0c1ac5656e"><div class="ttname"><a href="../../d5/dac/_t_c_s3200_8h.html#a7c17ec4eb2e59a7c01f8ec0c1ac5656e">TCS3200_OFREQ_20P</a></div><div class="ttdeci">#define TCS3200_OFREQ_20P</div><div class="ttdoc">20% frequency scaling</div><div class="ttdef"><b>Definition</b> TCS3200.h:159</div></div>
</div><!-- fragment --><h1><a class="anchor" id="autotoc_md15"></a>
White Balancing</h1>
<p>White balancing is essential for achieving accurate color measurements. It allows users to calibrate the sensor based on a known white reference color. Use the <code>white_balance()</code> function to set the white balance with an RGBColor structure, and <code>white_balance()</code> to retrieve the current white balance settings.</p>
Expand All @@ -188,25 +184,22 @@ <h1><a class="anchor" id="autotoc_md11"></a>
<div class="line"> colorSensor.begin();</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// Perform white balancing with a known white reference color (255, 255, 255)</span></div>
<div class="line"> <a class="code hl_struct" href="../../d0/d8a/struct___r_g_b_color.html">RGBColor</a> whiteReference = {255, 255, 255};</div>
<div class="line"> RGBColor whiteReference = {255, 255, 255};</div>
<div class="line"> colorSensor.white_balance(whiteReference);</div>
<div class="line">}</div>
</div><!-- fragment --><h1><a class="anchor" id="autotoc_md16"></a>
Color Space Conversions</h1>
<p>The TCS3200 library supports color space conversions from RGB to other color spaces, including HSV, CMYK, and CIE 1931 XYZ. Use the corresponding functions (<code>read_hsv()</code>, <code>read_cmyk()</code>, and <code>read_cie1931()</code>) to obtain color representations in the desired color space.</p>
<div class="fragment"><div class="line"><span class="keywordtype">void</span> loop() {</div>
<div class="line"> <span class="comment">// Read color in HSV color space</span></div>
<div class="line"> <a class="code hl_struct" href="../../d4/dc0/struct___h_s_v_color.html">HSVColor</a> hsvColor = colorSensor.read_hsv();</div>
<div class="line"> HSVColor hsvColor = colorSensor.read_hsv();</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// Read color in CMYK color space</span></div>
<div class="line"> <a class="code hl_struct" href="../../d4/dd1/struct___c_m_y_k_color.html">CMYKColor</a> cmykColor = colorSensor.read_cmyk();</div>
<div class="line"> CMYKColor cmykColor = colorSensor.read_cmyk();</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// Read color in CIE 1931 XYZ color space</span></div>
<div class="line"> <a class="code hl_struct" href="../../dc/d69/struct___c_i_e1931.html">CIE1931Color</a> cie1931Color = colorSensor.read_cie1931();</div>
<div class="line"> CIE1931Color cie1931Color = colorSensor.read_cie1931();</div>
<div class="line">}</div>
<div class="ttc" id="astruct___c_i_e1931_html"><div class="ttname"><a href="../../dc/d69/struct___c_i_e1931.html">_CIE1931</a></div><div class="ttdoc">Structure to represent CIE 1931 XYZ color values.</div><div class="ttdef"><b>Definition</b> TCS3200.h:201</div></div>
<div class="ttc" id="astruct___c_m_y_k_color_html"><div class="ttname"><a href="../../d4/dd1/struct___c_m_y_k_color.html">_CMYKColor</a></div><div class="ttdoc">Structure to represent CMYK color values.</div><div class="ttdef"><b>Definition</b> TCS3200.h:189</div></div>
<div class="ttc" id="astruct___h_s_v_color_html"><div class="ttname"><a href="../../d4/dc0/struct___h_s_v_color.html">_HSVColor</a></div><div class="ttdoc">Structure to represent HSV color values.</div><div class="ttdef"><b>Definition</b> TCS3200.h:178</div></div>
</div><!-- fragment --><h1><a class="anchor" id="autotoc_md17"></a>
Nearest Color Detection</h1>
<p>The library provides a template function <code>nearest_color()</code> that allows users to find the nearest color label based on the current sensor readings. This is useful for applications like color classification and sorting.</p>
Expand All @@ -216,7 +209,7 @@ <h1><a class="anchor" id="autotoc_md11"></a>
<div class="line"> </div>
<div class="line"> <span class="comment">// Color labels and corresponding RGBColor values</span></div>
<div class="line"> String colorLabels[] = {<span class="stringliteral">&quot;Red&quot;</span>, <span class="stringliteral">&quot;Green&quot;</span>, <span class="stringliteral">&quot;Blue&quot;</span>, <span class="stringliteral">&quot;Yellow&quot;</span>, <span class="stringliteral">&quot;Orange&quot;</span>};</div>
<div class="line"> <a class="code hl_struct" href="../../d0/d8a/struct___r_g_b_color.html">RGBColor</a> colorValues[] = {</div>
<div class="line"> RGBColor colorValues[] = {</div>
<div class="line"> {255, 0, 0},</div>
<div class="line"> {0, 255, 0},</div>
<div class="line"> {0, 0, 255},</div>
Expand Down Expand Up @@ -244,8 +237,8 @@ <h1><a class="anchor" id="autotoc_md11"></a>
<div class="line"> colorSensor.begin();</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// Set interrupt callbacks with upper and lower color thresholds</span></div>
<div class="line"> <a class="code hl_struct" href="../../d0/d8a/struct___r_g_b_color.html">RGBColor</a> upperThreshold = {200, 200, 200};</div>
<div class="line"> <a class="code hl_struct" href="../../d0/d8a/struct___r_g_b_color.html">RGBColor</a> lowerThreshold = {100, 100, 100};</div>
<div class="line"> RGBColor upperThreshold = {200, 200, 200};</div>
<div class="line"> RGBColor lowerThreshold = {100, 100, 100};</div>
<div class="line"> </div>
<div class="line"> colorSensor.upper_bound_interrupt(upperThreshold, upperThresholdExceeded);</div>
<div class="line"> colorSensor.lower_bound_interrupt(lowerThreshold, lowerThresholdExceeded);</div>
Expand Down
12 changes: 6 additions & 6 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,14 @@ <h2><a class="anchor" id="autotoc_md1"></a>
<p>To achieve accurate color sensing, the TCS3200 library employs both frequency and analog output modes to calibrate and interpret color data. Additionally, the library allows users to customize the integration time and frequency scaling of the sensor to optimize performance for specific applications.</p>
<h2><a class="anchor" id="autotoc_md2"></a>
Algorithm Overview</h2>
<p>The <a class="el" href="d5/d46/class_t_c_s3200.html" title="Class representing the TCS3200 color sensor.">TCS3200</a> Arduino Library is designed with simplicity and extensibility in mind. It offers a wide range of functionalities, from basic color sensing to advanced features like white balancing, color space conversions, and nearest color detection.</p>
<p>The TCS3200 Arduino Library is designed with simplicity and extensibility in mind. It offers a wide range of functionalities, from basic color sensing to advanced features like white balancing, color space conversions, and nearest color detection.</p>
<p>Here's an overview of the key functions and their roles in the library:</p>
<ul>
<li><p class="startli"><b>Initialization</b></p>
<p class="startli">The <code>begin()</code> function initializes the <a class="el" href="d5/d46/class_t_c_s3200.html" title="Class representing the TCS3200 color sensor.">TCS3200</a> sensor by configuring the necessary pins and setting default integration time and frequency scaling.</p>
<p class="startli">The <code>begin()</code> function initializes the TCS3200 sensor by configuring the necessary pins and setting default integration time and frequency scaling.</p>
</li>
<li><p class="startli"><b>Color Reading</b></p>
<p class="startli">Access the red, green, and blue intensity values captured by the <a class="el" href="d5/d46/class_t_c_s3200.html" title="Class representing the TCS3200 color sensor.">TCS3200</a> color sensor. These raw RGB values can be used to analyze the color composition of an object or its surroundings. The library provides four functions to read the intensity of each color channel: <code>read_red()</code>, <code>read_green()</code>, <code>read_blue()</code>, and <code>read_clear()</code>. The clear channel reading is used for calibration and to calculate the RGB color intensity values.</p>
<p class="startli">Access the red, green, and blue intensity values captured by the TCS3200 color sensor. These raw RGB values can be used to analyze the color composition of an object or its surroundings. The library provides four functions to read the intensity of each color channel: <code>read_red()</code>, <code>read_green()</code>, <code>read_blue()</code>, and <code>read_clear()</code>. The clear channel reading is used for calibration and to calculate the RGB color intensity values.</p>
</li>
<li><p class="startli"><b>Calibration</b></p>
<p class="startli">Achieve better color accuracy with sensor calibration. The library includes methods to calibrate the sensor in both light and dark environments, resulting in more reliable and consistent color measurements.</p>
Expand Down Expand Up @@ -279,9 +279,9 @@ <h2><a class="anchor" id="autotoc_md8"></a>
Getting Started</h2>
<p>To start using TCS3200 color sensor library in your Arduino projects, follow these simple steps:</p>
<ol type="1">
<li>Download the TCS3200-Color-Sensor library from the GitHub repository.</li>
<li>Extract the downloaded archive and rename the folder to "TCS3200-Color-Sensor".</li>
<li>Move the "TCS3200-Color-Sensor" folder to the Arduino libraries directory on your computer.<ul>
<li>Download the TCS3200 library from the GitHub repository.</li>
<li>Extract the downloaded archive and rename the folder to "TCS3200".</li>
<li>Move the "TCS3200" folder to the Arduino libraries directory on your computer.<ul>
<li>Windows: <code>Documents\Arduino\libraries\</code></li>
<li>MacOS: <code>~/Documents/Arduino/libraries/</code></li>
<li>Linux: <code>~/Arduino/libraries/</code></li>
Expand Down
33 changes: 1 addition & 32 deletions docs/menudata.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,35 +24,4 @@
*/
var menudata={children:[
{text:"Main Page",url:"index.html"},
{text:"Related Pages",url:"pages.html"},
{text:"Classes",url:"annotated.html",children:[
{text:"Class List",url:"annotated.html"},
{text:"Class Index",url:"classes.html"},
{text:"Class Members",url:"functions.html",children:[
{text:"All",url:"functions.html",children:[
{text:"b",url:"functions.html#index_b"},
{text:"c",url:"functions.html#index_c"},
{text:"f",url:"functions.html#index_f"},
{text:"g",url:"functions.html#index_g"},
{text:"h",url:"functions.html#index_h"},
{text:"i",url:"functions.html#index_i"},
{text:"l",url:"functions.html#index_l"},
{text:"m",url:"functions.html#index_m"},
{text:"n",url:"functions.html#index_n"},
{text:"r",url:"functions.html#index_r"},
{text:"s",url:"functions.html#index_s"},
{text:"t",url:"functions.html#index_t"},
{text:"u",url:"functions.html#index_u"},
{text:"v",url:"functions.html#index_v"},
{text:"w",url:"functions.html#index_w"},
{text:"x",url:"functions.html#index_x"},
{text:"y",url:"functions.html#index_y"},
{text:"z",url:"functions.html#index_z"}]},
{text:"Functions",url:"functions_func.html"},
{text:"Variables",url:"functions_vars.html"}]}]},
{text:"Files",url:"files.html",children:[
{text:"File List",url:"files.html"},
{text:"File Members",url:"globals.html",children:[
{text:"All",url:"globals.html"},
{text:"Typedefs",url:"globals_type.html"},
{text:"Macros",url:"globals_defs.html"}]}]}]}
{text:"Related Pages",url:"pages.html"}]}
19 changes: 1 addition & 18 deletions docs/navtreedata.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,30 +36,13 @@ var NAVTREE =
[ "Nearest Color Detection", "d5/d33/example.html#autotoc_md17", null ],
[ "Interrupt Callbacks", "d5/d33/example.html#autotoc_md18", null ],
[ "Integration in the Loop", "d5/d33/example.html#autotoc_md19", null ]
] ],
[ "Classes", "annotated.html", [
[ "Class List", "annotated.html", "annotated_dup" ],
[ "Class Index", "classes.html", null ],
[ "Class Members", "functions.html", [
[ "All", "functions.html", null ],
[ "Functions", "functions_func.html", null ],
[ "Variables", "functions_vars.html", null ]
] ]
] ],
[ "Files", "files.html", [
[ "File List", "files.html", "files_dup" ],
[ "File Members", "globals.html", [
[ "All", "globals.html", null ],
[ "Typedefs", "globals_type.html", null ],
[ "Macros", "globals_defs.html", null ]
] ]
] ]
] ]
];

var NAVTREEINDEX =
[
"annotated.html"
"d5/d33/example.html"
];

var SYNCONMSG = 'click to disable panel synchronisation';
Expand Down
Loading

0 comments on commit d70fdf2

Please sign in to comment.