renk sensoru kullanimi(TCS3200)

Dependencies:   mbed TCS3200

Files at this revision

API Documentation at this revision

Comitter:
marvas
Date:
Sat Jan 05 06:58:03 2019 +0000
Commit message:
renk sensoru kullanimi

Changed in this revision

TCS3200.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TCS3200.lib	Sat Jan 05 06:58:03 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/grantphillips/code/TCS3200/#b98e768bc655
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Jan 05 06:58:03 2019 +0000
@@ -0,0 +1,25 @@
+ #include "mbed.h"
+ #include "TCS3200.h"
+
+ TCS3200 color(A0, A1, A2, A3, A4);  //Create a TCS3200 object 
+ //            S0    S1    S2     S3     OUT
+ 
+ int main() {
+     long red, green, blue, clear;
+    
+     //Set the scaling factor to 100%
+     color.SetMode(TCS3200::SCALE_100);        
+
+     while(1){
+         //Read the HIGH pulse width in nS for each color.
+         //The lower the value, the more of that color is detected 
+         red = color.ReadRed();
+         green = color.ReadGreen();
+         blue = color.ReadBlue();
+         clear = color.ReadClear();
+
+         printf("RED: %10d     GREEN: %10d     BLUE: %10d     CLEAR: %10d    \n ", red, green, blue, clear);
+            
+         wait(0.1);
+     }
+ }
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Jan 05 06:58:03 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/3a7713b1edbc
\ No newline at end of file