[ arduino ] 버튼 상태 확인 > arduino

본문 바로가기
사이트 내 전체검색

arduino

[ arduino ] 버튼 상태 확인

작성자 웹지기
작성일 21-01-20 17:47 | 조회 4,345 | 댓글 0

본문

파일 > 예제 > 01. basics > DigitalReadSerial

 

int pushButton = 2;


void setup() {

  Serial.begin(9600); //반드시 필요(포트(모니터)에 연결)

  pinMode(pushButton, INPUT);

}


void loop() {

  int buttonState = digitalRead(pushButton);

  Serial.println(buttonState);

  delay(1);

}

 

KakaoTalk_20210121_092631585.png

0 0

댓글목록 0

등록된 댓글이 없습니다.

arduino 목록

Total 25
게시물 검색

회원로그인

접속자집계

오늘
20,822
어제
36,187
최대
61,067
전체
18,087,999

그누보드5
Copyright © www.funyphp.com. All rights reserved.