-
-
-
Phí vận chuyển: Tính khi thanh toánTổng tiền thanh toán:
-
Cảm biến hồng ngoại SHARP GP2Y0A21YK0F (10cm-80cm)
Thương hiệu: Chưa cập nhật
230.000₫
Description :
This popular IR based sensor from SHARP electronics is capable of producing analog signals in accordance with distance from the target object. The output value varies from 3.1V at 10cm to 0.3V at 80cm .Can be directly interfaced with SPDuino using the analog ports.
Features:
Distance measuring range: 10 to 80 cm
Analog output type
Specifications:
Supply voltage: 4.5 to 5.5 V
Consumption current: Typ. 30 mA
Data sheet: PDF
Test Code
void setup()
{
Serial.begin(9600);
}
void loop()
{
float X;
float V = analogRead(A0) * 5.0/1023.0;
if( V < 0.75 ) {
X = ( 27.0/(V - 0.08) ) - 1.8;
} else {
X = ( 34.0/(V + 0.08) );
}
Serial.println(X);
delay(500);
}