คำอธิบาย
เซนเซอร์ตรวจจับสี Color RGB Sensor Module TCS34725
TCS3472 ให้ค่า แบบดิจิทัลสำหรับการตรวจจับสีแดง เขียว น้ำเงิน (RGB) และแสงจ้า โฟโตไดโอดที่ไวต่อสีรวมชิ้นส่วนและฟิลเตอร์ IR อินฟราเรด ซึ่งช่วยลดส่วนประกอบสเปกตรัมอินฟราเรดของแสงที่ตกกระทบ และทำให้การจัดการสีแม่นยำยิ่งขึ้น ความไวแสงสูง ช่วงไดนามิกกว้าง และฟิลเตอร์ปิดกั้น IR ทำให้ TCS3472
Product parameters:
- Working voltage 3.3~5V
- Detection distance 3~10mm
- Communication IIC
Pin description
- 1. VIN power supply positive
- 2. GND Negative pole of power supply
- 3. 3V3 3.3V output
- 4. SCL clock signal
- 5. SDA data signal
- 6. INT interrupt output, active low
- 7. LED lights near the LED control sensor, high level signal or suspension The LED light is on when empty, and the LED light is off when the signal is low
#include "TCS34725.h"
TCS34725 tcs;
void setup(void){
Serial.begin(115200);
Wire.begin();
if (!tcs.attach(Wire))
Serial.println("ERROR: TCS34725 NOT FOUND !!!");
tcs.integrationTime(33); // ms
tcs.gain(TCS34725::Gain::X01);
// set LEDs...
}
void loop(void){
if (tcs.available())
{
static uint32_t prev_ms = millis();
TCS34725::Color color = tcs.color();
//Serial.print("Interval : "); Serial.println(millis() - prev_ms);
//Serial.print("Color Temp : "); Serial.println(tcs.colorTemperature());
//Serial.print("Lux : "); Serial.println(tcs.lux());
//Serial.print("R : "); Serial.println(color.r);
//Serial.print("G : "); Serial.println(color.g);
//Serial.print("B : "); Serial.println(color.b);
TCS34725::RawData raw = tcs.raw();
Serial.print("Raw R,G,B,C : ");
Serial.print(raw.r); Serial.print(", ");
Serial.print(raw.g); Serial.print(", ");
Serial.print(raw.b); Serial.print(", ");
Serial.println(raw.c);
prev_ms = millis();
}
}






รีวิว
ยังไม่มีบทวิจารณ์