제조사 | OEM |
---|---|
브랜드 | 에듀이노 |
판매가 | 3,300원 |
할인판매가 | 2,640원 (20% 할인) |
적립금 | 30원 |
자체상품코드 | D-138 |
국내·해외배송 | 국내배송 |
배송방법 | 택배 |
수량 |
COMMENT |
(최소주문수량 1개 이상 / 최대주문수량 0개 이하)
사이즈 가이드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 32 33 34 35 36 | // 조이스틱의 X 및 Y 축이 연결된 아날로그 핀 설정 const int xAxisPin = 5; const int yAxisPin = 6; // 스위치 핀 설정 const int switchPin = 7; void setup() { // 시리얼 통신 초기화 Serial.begin(9600); // 스위치 핀을 입력으로 설정 pinMode(switchPin, INPUT_PULLUP); } void loop() { // X 및 Y 축에서 아날로그 값 읽기 int xAxisValue = digitalRead(xAxisPin); int yAxisValue = digitalRead(yAxisPin); // 스위치 상태 읽기 int switchState = digitalRead(switchPin); // 읽은 값 시리얼 모니터에 출력 Serial.print("X축: "); Serial.print(xAxisValue); Serial.print(", Y축: "); Serial.print(yAxisValue); Serial.print(", 스위치: "); Serial.println(switchState); // 500ms 지연 delay(500); } | cs |