BASIC4MCU | 질문게시판 | 답변 : 아두이노 서보모터 버튼으로 구동
페이지 정보
작성자 master 작성일2018-09-04 17:37 조회6,531회 댓글1건
https://www.basic4mcu.com/bbs/board.php?bo_table=gac&wr_id=5316
본문
// MCU BASIC: https://www.basic4mcu.com// DateTime : 2018-09-10 오후 5:51:40// by Ok-Hyun Park//#include <Servo.h>Servo myservo;int button1Pin=2;//void setup(){pinMode(button1Pin,INPUT);myservo.attach(9);}//void loop(){if(digitalRead(button1Pin)==LOW){myservo.write(180); delay(1000); myservo.write(0);}}
댓글 1
조회수 6,531호나규님의 댓글
호나규 작성일
바쁘신중에 답변주셔서 감사합니다
좋은 저녁되세요 ^^