รหัสสินค้า | B23 |
หมวดหมู่ | การเคลื่อนไหว การสั่น การเอียง |
ราคา | 20.00 บาท |
สถานะสินค้า | พร้อมส่ง |
ลงสินค้า | 30 ก.ค. 2561 |
อัพเดทล่าสุด | 27 ส.ค. 2567 |
คงเหลือ | 27 ชิ้น |
จำนวน | ชิ้น |
Three connections to your Arduino is all you need. The pins on the knock sensor that you will connect to are shown in the picture below:
ตัวอย่างโค้ต โมดูลตรวจจับการชน การกระแทก KY-031//Henry's Bench
//KY-031 Knock Sensor Tutorial
int knockPin = 10; // Use Pin 10 as our Input
int knockVal = HIGH; // This is where we record our shock measurement
boolean bAlarm = false;
unsigned long lastKnockTime; // Record the time that we measured a shock
int knockAlarmTime = 500; // Number of milli seconds to keep the knock alarm high
void setup ()
{
Serial.begin(9600);
pinMode (knockPin, INPUT) ; // input from the KY-031
}
void loop ()
{
knockVal = digitalRead (knockPin) ; // read KY-031 Value
if (knockVal == LOW) // If we see a knock
{
lastKnockTime = millis(); // record the time of the shock
// The following is so you don't scroll on the output screen
if (!bAlarm){
Serial.println("KNOCK, KNOCK");
bAlarm = true;
}
}
else
{
if( (millis()-lastKnockTime) > knockAlarmTime && bAlarm){
Serial.println("no knocks");
bAlarm = false;
}
}
}
ชำระเงินค่าสินค้าโดยการโอนเงินเข้าบัญชีด้านล่าง โดยลูกค้าสามารถโอนเงินหลังทำรายการสั่งซื้อได้ทันทีไม่ต้องรอยืนยัน
หลังจากโอนเงินแล้วสามารถแจ้งชำระเงินได้ที่ เมนูแจ้งชำระเงิน
หรือชำระเงินผ่าน PayPal โดยคลิกที่ ชำระเงินออนไลน์
หน้าที่เข้าชม | 1,830,165 ครั้ง |
ผู้ชมทั้งหมด | 799,165 ครั้ง |
เปิดร้าน | 12 ธ.ค. 2558 |
ร้านค้าอัพเดท | 8 ก.ย. 2568 |