제품 소스코드 다운로드 – Sharp Dust Sensor (GP2Y1010AU0F)

다운로드
Download is available until [expire_date]
  • 버전 sample
  • 다운로드 21
  • 파일 크기 1
  • 파일 수 1
  • 생성 날짜 2017-08-24
  • 마지막 업데이트 2017-09-30

제품 소스코드 다운로드 - Sharp Dust Sensor (GP2Y1010AU0F)

int dustPin=0;
float dustVal=0;
float dustDensity = 0;

int ledPower=2;
int delayTime=280;
int delayTime2=40;
float offTime=9680;

void setup(){
Serial.begin(9600);
pinMode(ledPower,OUTPUT);
pinMode(4, OUTPUT);
}

void loop(){
// ledPower is any digital pin on the arduino connected to Pin 3 on the sensor
digitalWrite(ledPower,LOW); // power on the LED
delayMicroseconds(delayTime);

dustVal=analogRead(dustPin); // read the dust value via pin 5 on the sensor
delayMicroseconds(delayTime2);

digitalWrite(ledPower,HIGH); // turn the LED off
delayMicroseconds(offTime);

delay(3000);

dustDensity = 0.17*(dustVal*0.0049)-0.1;
Serial.print("Dust density(mg/m3) = ")
Serial.println(dustDensity);
}

© Copyright 2016 - , eduiot.kr All Rights Reserved. 에듀 아이오티
아두이노 정보 나눔 사이트 | Тel: 070-7613-1114 / 010-9762-8316 |개인정보 보호정책 |이용약관
사업자: 638-23-00575 | 주소: 인천 부평구 안남로5번길 39 | R.Elena
통신판매: 인천부평-2017-0803 | 정보관리: 나승백 | host:hostner
e-mail: eduiot.kr@gmail.com | 구매안전서비스확인|

카톡-ID: eduiot | Тel:070-7613-1114 / 010-9762-8316 개인정보취급방침

에듀아이오티. www.eduiot.kr

0

Your Cart