Danh sách sản phẩm

Cảm biến cử chỉ và màu sắc APDS-9960

Mã sản phẩm: IMA165   |   Tình trạng: Còn 5 sản phẩm có sẵn
72.000₫
  • Nhập IMA-90 giảm 90%, tối đa 2K
  • Nhập IMA-5K giảm 5k, đơn từ 199K
  • Nhập IMA-35K giảm 35k, đơn từ 499K

Mô tả sản phẩm

Cảm biến cử chỉ và màu sắc APDS-9960 RGB and Gesture Sensor được sử dụng để nhận biết cử chỉ như vuốt tay lên xuống, trái phải, xa gần, ngoài ra cảm biến còn nhận biết được màu sắc qua cường độ của 3 màu cơ bản RGB,cảm biến sử dụng giao tiếp I2C với bộ code mẫu rất dể sử dụng.

Thông số kỹ thuật:

  • Điện áp sử dụng: 3.3VDC
  • Cảm biến được các cử chỉ vuốt tay lên xuống, trái phải, xa gần.
  • Nhận biết được màu sắc qua cường độ của 3 màu cơ bản RGB.
  • Khoảng cách cảm biến đến vật thể: max 10~20cm (tùy màu sắc, hình dạng và bề mặt vật thể.
  • Giao tiếp I2C (I2C Address: 0x39).
  • Kích thước: 20.6 x 15.1mm

Code tham khảo Arduino:

 

/****************************************************************
 * Kết nối:
 *          APDS-9960                Uno              Mega
 *            VCC                    3.3V             3.3V
 *            GND                    GND              GND
 *            SCL                    A5               SCL
 *            SDA                    A4               SDA
 *            
 *            
 * Nạp code mở Serial Monitor chọn No line ending, baud 9600.
 * 
 * 
****************************************************************/
#include 
#include 
// Global Variables
SparkFun_APDS9960 apds = SparkFun_APDS9960();
uint8_t proximity_data = 0;
void setup() {
  // Initialize Serial port
  Serial.begin(9600);
  Serial.println();
  Serial.println(F("------------------------------------"));
  Serial.println(F("SparkFun APDS-9960 - ProximitySensor"));
  Serial.println(F("------------------------------------"));
  // Initialize APDS-9960 (configure I2C and initial values)
  if ( apds.init() ) {
    Serial.println(F("APDS-9960 initialization complete"));
  } else {
    Serial.println(F("Something went wrong during APDS-9960 init!"));
  }
  // Adjust the Proximity sensor gain
  if ( !apds.setProximityGain(PGAIN_2X) ) {
    Serial.println(F("Something went wrong trying to set PGAIN"));
  }
  // Start running the APDS-9960 proximity sensor (no interrupts)
  if ( apds.enableProximitySensor(false) ) {
    Serial.println(F("Proximity sensor is now running"));
  } else {
    Serial.println(F("Something went wrong during sensor init!"));
  }
}
void loop() {
  // Read the proximity value
  if ( !apds.readProximity(proximity_data) ) {
    Serial.println("Error reading proximity value");
  } else {
    Serial.print("Proximity: ");
    Serial.println(proximity_data);
  }
  // Wait 250 ms before next reading
  delay(250);
}

Tài liệu tham khảo:

Video tham khảo:

Khách hàng nhận xét