BASIC4MCU | 질문게시판 | 아두이노 코딩
페이지 정보
작성자 대구간 작성일2019-05-20 19:19 조회3,340회 댓글0건
https://www.basic4mcu.com/bbs/board.php?bo_table=gac&wr_id=8679
본문
void
setup() {
Serial.begin(9600);
}
void
loop() {
int
sensorValue = analogRead(A0);
float
voltage = sensorValue * (5.0 / 1023.0);
Serial.print(
"sensorValue = "
);
Serial.print(sensorValue);
Serial.print(
", voltage = "
);
Serial.println(voltage);
}
제가 serial monitor 를 이용해 가변저항을 왼쪽과 오른쪽으로 돌리면 전압값이 나오는 코딩을 짰는데 map함수를 이용해서 가변저항의 현재위치(각도)를 나오게 하려면 저기서 뭘 고쳐야 할지 잘 모르겠습니다ㅠㅠ
댓글 0
조회수 3,340등록된 댓글이 없습니다.