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
- 자바
- 코딩테스트
- 백준
- 빅데이터
- 개인프로젝트
- Reflex
- 자바정리
- 모의 주식
- backend
- frontend
- java정리
- SNS
- 자바독학
- 주가예측
- 사물인터넷
- Project
- 프로그래머스
- 풀스택프레임워크
- 코딩
- 이웃한 칸
- 코딩독학
- 코테
- java
- 프로그래밍
- 개발
- Python
- 프로그램
- C++
- 개발자
- 코스닥
Archives
- Today
- Total
Creative Code
09_tone 본문
#define V0 5.0
#define unit V0/1024
#define R1 10000.0
const int Xin = A0;
const int Yin = A1;
const int KEYin = 3;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
pinMode(KEYin,INPUT_PULLUP); // 칩 내부에 있는 pull up 저항을 사용
}
void loop() {
// put your main code here, to run repeatedly:
int Xval = analogRead(Xin);
int Yval = analogRead(Yin);
int buttonval = digitalRead(KEYin);
Serial.print("x = ");
Serial.print(Xval);
Serial.print(", ");
Serial.print("y = ");
Serial.print(Yval);
Serial.print(", ");
Serial.print(" Button is ");
if (buttonval == HIGH) {
Serial.println("not pressed");
} else {
Serial.println("pressed");
}
delay(300);
}
'Arduino(C,C++)' 카테고리의 다른 글
11_timer1_led (0) | 2023.08.14 |
---|---|
10_ultrasonic(초음파 거리재기) (0) | 2023.08.11 |
08_joystick (0) | 2023.08.11 |
07_Analog_Read-(2) 조명센서밝기에 따른 led밝기 조절 (0) | 2023.08.11 |
07_Analog_Read (0) | 2023.08.11 |