{{ 'fb_in_app_browser_popup.desc' | translate }} {{ 'fb_in_app_browser_popup.copy_link' | translate }}
{{ 'in_app_browser_popup.desc' | translate }}
{{ childProduct.title_translations | translateModel }}
{{ getChildVariationShorthand(childProduct.child_variation) }}
{{ getSelectedItemDetail(selectedChildProduct, item).childProductName }} x {{ selectedChildProduct.quantity || 1 }}
{{ getSelectedItemDetail(selectedChildProduct, item).childVariationName }}
貨號:SSI0048
商品存貨不足,未能加入購物車
您所填寫的商品數量超過庫存
{{'products.quick_cart.out_of_number_hint'| translate}}
{{'product.preorder_limit.hint'| translate}}
每筆訂單限購 {{ product.max_order_quantity }} 件
現庫存只剩下 {{ quantityOfStock }} 件
夏普製造的紅外線接近感測器,使用5PIN JST接頭,贈連接線。適用如3C、娛樂等產品開發應用。
Arduino 範例碼
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
/* Sharp GP2Y0A710K0F infrared proximity sensor (#28999) Collects an average of five readings from the sensor and displays the resulting value about every half second. See the Sharp_GP2Y0A710KOF_Simple demonstration for additional usage notes, including connection diagram. This example code is for the Arduino Uno and direct compatible boards, using the Arduino 1.0 or later IDE software. It has not been tested, nor designed for, other Arduino boards, including the Arduino Due. */ const int irSense = A0; // Connect sensor to analog pin A0 int distance = 0; void setup() { Serial.begin(9600); // Use Serial Monitor window } void loop() { Serial.println(irRead(), DEC); // Call irRead function to read sensor // Print value in Serial Monitor delay(250); // Wait another 1/4 second for the next read // (Note: Because of delays built into the // irRead function the display of values will // be slower than in the SharpGP2Y0A21_Simple // sketch } // Take multiple readings, and average them out to reduce false readings int irRead() { int averaging = 0; // Holds value to average readings // Get a sampling of 5 readings from sensor for (int i=0; i<5; i++) { distance = analogRead(irSense); averaging = averaging + distance; delay(55); // Wait 55 ms between each read // According to datasheet time between each read // is -38ms +/- 10ms. Waiting 55 ms assures each // read is from a different sample } distance = averaging / 5; // Average out readings return(distance); // Return value } |