기술문의 :)

기술문의 게시판 입니다.

뒤로가기
제목

왜 안되죠???

작성자 아트로봇(ip:)

작성일 2014-10-14 10:26:45

조회 92

평점 0점  

추천 추천하기

내용

안녕하세요

 

 

일단 아래와 같이 연결이 되었는지 다시 확인해보시고

 

아답터  아두이노
 GND    GND
 VCC    5V
 D       D2

 GND    GND
 VCC    5V
 A       A0  

 

미해결시 전체 연결상태를 여러장의 사진을 링크로 알려주시면  추가 의견 드리겠습니다.

 

아트로봇 드림

 

 


---------- Original Message ----------

어댑터를 사용해서 연결했습니다.

A0와 D2에 연결하고


VCC, GND를 각각 연결한 후 사용을 하는데


시리얼모니터 상에서 데이터가 변하지를 않습니다.


심지어 A0의 케이블을 뽑아도 값이 변하지 않습니다.

 

  

int measurePin = 0; //Connect dust sensor to Arduino A0 pin

int ledPower = 2;   //Connect 3 led driver pins of dust sensor to Arduino D2

  

int samplingTime = 280;

int deltaTime = 40;

int sleepTime = 9680;

  

float voMeasured = 0;

float calcVoltage = 0;

float dustDensity = 0;

  

void setup(){

  Serial.begin(9600);

  pinMode(ledPower,OUTPUT);

}

  

void loop(){

  digitalWrite(ledPower,LOW); // power on the LED

  delayMicroseconds(samplingTime);

  

  voMeasured = analogRead(measurePin); // read the dust value

  

  delayMicroseconds(deltaTime);

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

  delayMicroseconds(sleepTime);

  

  // 0 - 5V mapped to 0 - 1023 integer values

  // recover voltage

  calcVoltage = voMeasured * (5.0 / 1024.0);

  

  // linear eqaution taken from http://www.howmuchsnow.com/arduino/airquality/

  // Chris Nafis (c) 2012

  dustDensity = 0.17 * calcVoltage - 0.1;

  

  Serial.print("Raw Signal Value (0-1023): ");

  Serial.print(voMeasured);

  

  Serial.print(" - Voltage: ");

  Serial.print(calcVoltage);

  

  Serial.print(" - Dust Density: ");

  Serial.println(dustDensity); // unit: mg/m3

  

  delay(1000);

}

첨부파일

비밀번호
수정

비밀번호 입력후 수정 혹은 삭제해주세요.

댓글목록

등록된 댓글이 없습니다.

댓글 수정

이름

비밀번호

내용

/ byte

수정 취소

비밀번호 :

확인 취소

댓글 입력

이름

비밀번호

내용

/ byte

평점

왼쪽의 문자를 공백없이 입력하세요.

회원에게만 댓글 작성 권한이 있습니다.

관련 글 보기

follow us