當前位置:編程學習大全網 - 編程軟體 - 手勢傳感器

手勢傳感器

APDS-9960

具有先進的手勢檢測,接近檢測和數字環境光感應功能,是壹個采用單個8引腳封裝的數字RGB,環境光,近程和手勢傳感器。該裝置具有I2C兼容的接口,為紅色,綠色,藍色,和透明(RGBC),近程和手勢感測配有LED紅外,

APDS-9930

/Depau/APDS9930

/adafruit/Adafruit_APDS9960/zip/master

Adafruit_APDS9960 apds;

// the setup function runs once when you press reset or power the board

void setup() {

Serial.begin(115200);

if(!apds.begin()){

Serial.println("failed to initialize device! Please check your wiring.");

}

else Serial.println("Device initialized!");

//gesture mode will be entered once proximity mode senses something close

apds.enableProximity(true);

apds.enableGesture(true);

}

// the loop function runs over and over again forever

void loop() {

//read a gesture from the device

uint8_t gesture = apds.readGesture();

if(gesture == APDS9960_DOWN) Serial.println("v");

if(gesture == APDS9960_UP) Serial.println("^");

if(gesture == APDS9960_LEFT) Serial.println("<");

if(gesture == APDS9960_RIGHT) Serial.println(">");

}

  • 上一篇:vp編程可以做些什麽?自學難嗎?內容多嗎?來點實例!
  • 下一篇:在窗體上建立壹個由100個命令按鈕組成的10行10列控件數組 (vb編程)
  • copyright 2024編程學習大全網