1d3a61af6310aee910c68c1630879a22bbe90c42
Board-dat/SSL/SSL1037-dat/2024-04-28-16-24-10.png
| ... | ... | Binary files /dev/null and b/Board-dat/SSL/SSL1037-dat/2024-04-28-16-24-10.png differ |
Board-dat/SSL/SSL1037-dat/2024-04-28-16-24-30.png
| ... | ... | Binary files /dev/null and b/Board-dat/SSL/SSL1037-dat/2024-04-28-16-24-30.png differ |
Board-dat/SSL/SSL1037-dat/2024-04-28-16-26-17.png
| ... | ... | Binary files /dev/null and b/Board-dat/SSL/SSL1037-dat/2024-04-28-16-26-17.png differ |
Board-dat/SSL/SSL1037-dat/SSL1037-dat.md
| ... | ... | @@ -0,0 +1,148 @@ |
| 1 | + |
|
| 2 | +# SSL1037-dat |
|
| 3 | + |
|
| 4 | +- order link - https://www.electrodragon.com/product/tcs230-tcs3200d-color-sensing-sensor-module-inlcuding-wide-angle-lens/ |
|
| 5 | + |
|
| 6 | + |
|
| 7 | + |
|
| 8 | +- old version - [[3201579-dat]] - https://www.electrodragon.com/product/arduino-color-recognition-sensor-tcs230-module-detector-for-mcuavr/ |
|
| 9 | + |
|
| 10 | +## Wiring |
|
| 11 | + |
|
| 12 | + |
|
| 13 | + |
|
| 14 | + |
|
| 15 | + |
|
| 16 | + |
|
| 17 | +## Example code |
|
| 18 | + |
|
| 19 | +* Get the necessary timerone library here TimerOne |
|
| 20 | + |
|
| 21 | +code |
|
| 22 | + |
|
| 23 | + #include <TimerOne.h> |
|
| 24 | + |
|
| 25 | + #define S0 6 // Please notice the Pin's define |
|
| 26 | + #define S1 5 |
|
| 27 | + #define S2 4 |
|
| 28 | + #define S3 3 |
|
| 29 | + #define OUT 2 |
|
| 30 | + |
|
| 31 | + int g_count = 0; // count the frequecy |
|
| 32 | + int g_array[3]; // store the RGB value |
|
| 33 | + int g_flag = 0; // filter of RGB queue |
|
| 34 | + float g_SF[3]; // save the RGB Scale factor |
|
| 35 | + |
|
| 36 | + |
|
| 37 | + // Init TSC230 and setting Frequency. |
|
| 38 | + void TSC_Init() |
|
| 39 | + { |
|
| 40 | + pinMode(S0, OUTPUT); |
|
| 41 | + pinMode(S1, OUTPUT); |
|
| 42 | + pinMode(S2, OUTPUT); |
|
| 43 | + pinMode(S3, OUTPUT); |
|
| 44 | + pinMode(OUT, INPUT); |
|
| 45 | + |
|
| 46 | + digitalWrite(S0, LOW); // OUTPUT FREQUENCY SCALING 2% |
|
| 47 | + digitalWrite(S1, HIGH); |
|
| 48 | + } |
|
| 49 | + |
|
| 50 | + // Select the filter color |
|
| 51 | + void TSC_FilterColor(int Level01, int Level02) |
|
| 52 | + { |
|
| 53 | + if(Level01 != 0) |
|
| 54 | + Level01 = HIGH; |
|
| 55 | + |
|
| 56 | + if(Level02 != 0) |
|
| 57 | + Level02 = HIGH; |
|
| 58 | + |
|
| 59 | + digitalWrite(S2, Level01); |
|
| 60 | + digitalWrite(S3, Level02); |
|
| 61 | + } |
|
| 62 | + |
|
| 63 | + void TSC_Count() |
|
| 64 | + { |
|
| 65 | + g_count ++ ; |
|
| 66 | + } |
|
| 67 | + |
|
| 68 | + void TSC_Callback() |
|
| 69 | + { |
|
| 70 | + switch(g_flag) |
|
| 71 | + { |
|
| 72 | + case 0: |
|
| 73 | + Serial.println("->WB Start"); |
|
| 74 | + TSC_WB(LOW, LOW); //Filter without Red |
|
| 75 | + break; |
|
| 76 | + case 1: |
|
| 77 | + Serial.print("->Frequency R="); |
|
| 78 | + Serial.println(g_count); |
|
| 79 | + g_array[0] = g_count; |
|
| 80 | + TSC_WB(HIGH, HIGH); //Filter without Green |
|
| 81 | + break; |
|
| 82 | + case 2: |
|
| 83 | + Serial.print("->Frequency G="); |
|
| 84 | + Serial.println(g_count); |
|
| 85 | + g_array[1] = g_count; |
|
| 86 | + TSC_WB(LOW, HIGH); //Filter without Blue |
|
| 87 | + break; |
|
| 88 | + |
|
| 89 | + case 3: |
|
| 90 | + Serial.print("->Frequency B="); |
|
| 91 | + Serial.println(g_count); |
|
| 92 | + Serial.println("->WB End"); |
|
| 93 | + g_array[2] = g_count; |
|
| 94 | + TSC_WB(HIGH, LOW); //Clear(no filter) |
|
| 95 | + break; |
|
| 96 | + default: |
|
| 97 | + g_count = 0; |
|
| 98 | + break; |
|
| 99 | + } |
|
| 100 | + } |
|
| 101 | + |
|
| 102 | + void TSC_WB(int Level0, int Level1) //White Balance |
|
| 103 | + { |
|
| 104 | + g_count = 0; |
|
| 105 | + g_flag ++; |
|
| 106 | + TSC_FilterColor(Level0, Level1); |
|
| 107 | + Timer1.setPeriod(1000000); // set 1s period |
|
| 108 | + } |
|
| 109 | + |
|
| 110 | + void setup() |
|
| 111 | + { |
|
| 112 | + TSC_Init(); |
|
| 113 | + Serial.begin(9600); |
|
| 114 | + Timer1.initialize(); // defaulte is 1s |
|
| 115 | + Timer1.attachInterrupt(TSC_Callback); |
|
| 116 | + attachInterrupt(0, TSC_Count, RISING); |
|
| 117 | + |
|
| 118 | + delay(4000); |
|
| 119 | + |
|
| 120 | + for(int i=0; i<3; i++) |
|
| 121 | + Serial.println(g_array[i]); |
|
| 122 | + |
|
| 123 | + g_SF[0] = 255.0/ g_array[0]; //R Scale factor |
|
| 124 | + g_SF[1] = 255.0/ g_array[1] ; //G Scale factor |
|
| 125 | + g_SF[2] = 255.0/ g_array[2] ; //B Scale factor |
|
| 126 | + |
|
| 127 | + Serial.println(g_SF[0]); |
|
| 128 | + Serial.println(g_SF[1]); |
|
| 129 | + Serial.println(g_SF[2]); |
|
| 130 | + |
|
| 131 | + } |
|
| 132 | + |
|
| 133 | + void loop() |
|
| 134 | + { |
|
| 135 | + g_flag = 0; |
|
| 136 | + for(int i=0; i<3; i++) |
|
| 137 | + Serial.println(int(g_array[i] * g_SF[i])); |
|
| 138 | + delay(4000); |
|
| 139 | + |
|
| 140 | + } |
|
| 141 | + |
|
| 142 | + |
|
| 143 | +## output |
|
| 144 | + |
|
| 145 | + |
|
| 146 | +## ref |
|
| 147 | + |
|
| 148 | +- [[color-sensor-dat]] |
|
| ... | ... | \ No newline at end of file |
Chip-dat/TAOS-dat/2024-04-28-16-21-44.png
| ... | ... | Binary files /dev/null and b/Chip-dat/TAOS-dat/2024-04-28-16-21-44.png differ |
Chip-dat/TAOS-dat/TAOS-dat.md
| ... | ... | @@ -0,0 +1,12 @@ |
| 1 | + |
|
| 2 | +# TAOS-dat |
|
| 3 | + |
|
| 4 | +- [[TCS230-dat]] |
|
| 5 | + |
|
| 6 | +- [[TCS3200.pdf]] |
|
| 7 | + |
|
| 8 | + |
|
| 9 | + |
|
| 10 | +## schematic |
|
| 11 | + |
|
| 12 | + |
|
| ... | ... | \ No newline at end of file |
Chip-dat/TAOS-dat/TCS230-dat.md
| ... | ... | @@ -0,0 +1,10 @@ |
| 1 | + |
|
| 2 | +# TCS230-dat |
|
| 3 | + |
|
| 4 | +- https://datasheetspdf.com/pdf-down/T/C/S/TCS230-TAOS.pdf |
|
| 5 | + |
|
| 6 | +- https://w.electrodragon.com/w/TCS230 |
|
| 7 | + |
|
| 8 | + |
|
| 9 | + |
|
| 10 | +- [[SSL1037-dat]] |
|
| ... | ... | \ No newline at end of file |
Chip-dat/TAOS-dat/TCS3200.pdf
| ... | ... | Binary files /dev/null and b/Chip-dat/TAOS-dat/TCS3200.pdf differ |
Tech/Sensor-dat/color-sensor-dat/color-sensor-dat.md
| ... | ... | @@ -0,0 +1,9 @@ |
| 1 | + |
|
| 2 | +# color-sensor-dat |
|
| 3 | + |
|
| 4 | +https://w.electrodragon.com/w/Category:Color_sensor |
|
| 5 | + |
|
| 6 | + |
|
| 7 | +## ref |
|
| 8 | + |
|
| 9 | +- [[SSL1037-dat]] - [[TCS230-dat]] |
|
| ... | ... | \ No newline at end of file |