
renk sensoru kullanimi(TCS3200)
Revision 0:9f82bd528461, committed 2019-01-05
- Comitter:
- marvas
- Date:
- Sat Jan 05 06:58:03 2019 +0000
- Commit message:
- renk sensoru kullanimi
Changed in this revision
--- /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