배송 |
---|
상품 정보 | 가격 | 삭제 |
---|---|---|
아두이노 적외선 거리 센서 모듈 I2C 출력 GP2Y0E03 | ||
TOTAL PRICE(수량) 0 |
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 |
#define PLOTTER
#include <Wire.h>
#include "GP2Y0E03.h"
const int GP2Y0E03_I2C_ADDR = 0x40;
GP2Y0E03 gp2y0e03(GP2Y0E03_I2C_ADDR);
void setup() {
Serial.begin(9600);
Wire.begin();
}
void loop() {
float distance;
distance = gp2y0e03.get_length();
if (distance == -1) {
distance = 0;
}
Serial.print("Distance:");
Serial.print(distance);
Serial.println("cm");
delay(500);
}
|
cs |