Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 26 | 27 |
28 | 29 | 30 | 31 |
Tags
- 모의 주식
- C++
- 코딩
- 사물인터넷
- 빅데이터
- java정리
- 코스닥
- SNS
- 개발자
- 이웃한 칸
- 코딩테스트
- java
- 개인프로젝트
- Python
- 자바정리
- 백준
- 자바
- Reflex
- 개발
- 풀스택프레임워크
- frontend
- backend
- 프로그래머스
- 프로그램
- 코딩독학
- 자바독학
- Project
- 프로그래밍
- 주가예측
- 코테
Archives
- Today
- Total
Creative Code
07_Analog_Read 본문
#define V0 5.0
#define unit V0/1024
#define R1 10000.0
const int analogPin = A0;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
}
void loop() {
// put your main code here, to run repeatedly:
int analogValue = analogRead(analogPin); // analogpin에 연결했을때
float V2 = analogValue * unit;
float R2 = V2 * R1 / (V0 - V2);
Serial.print(analogValue);
Serial.print(", ");
Serial.print(analogValue * unit);
Serial.print("V,");
Serial.println(R2);
delay(300);
}
'Arduino(C,C++)' 카테고리의 다른 글
08_joystick (0) | 2023.08.11 |
---|---|
07_Analog_Read-(2) 조명센서밝기에 따른 led밝기 조절 (0) | 2023.08.11 |
EX03_binary_led_interrupt -(2) (2,3번핀이 아닌 다른핀에 버튼을 연결할때) (0) | 2023.08.11 |
06_SW_INPUT_interrupt(스위치누를때마다 led on/off) (0) | 2023.08.11 |
EX03_binary_led_interrupt -(1) (버튼누를 때마다 다음 이진수 led출력) (0) | 2023.08.11 |