BASIC4MCU | 질문게시판 | 답변 : 스텝모터 제어
페이지 정보
작성자 master 작성일2018-08-07 15:12 조회11,265회 댓글0건
https://www.basic4mcu.com/bbs/board.php?bo_table=gac&wr_id=2684
본문
// MCU BASIC: https://www.basic4mcu.com// DateTime : 2018-08-07 오후 3:16:32// by Ok-Hyun Park//int DirPIN=8,ClkPIN=9,EnvPIN=10;//void setup(){Serial.begin(9600);digitalWrite(DirPIN,1); pinMode(DirPIN,OUTPUT);digitalWrite(ClkPIN,1); pinMode(ClkPIN,OUTPUT);digitalWrite(EnvPIN,0); pinMode(EnvPIN,OUTPUT);}//void loop(){Serial.println("+direction");digitalWrite(DirPIN,1);for(int i=0;i<200;i++){digitalWrite(ClkPIN,0); delay(2);digitalWrite(ClkPIN,1); delay(2);}delay(500);//Serial.println("-dirction");digitalWrite(DirPIN,0);for(int i=0;i<200;i++){digitalWrite(ClkPIN,0); delay(2);digitalWrite(ClkPIN,1); delay(2);}delay(500);}
댓글 0
조회수 11,265등록된 댓글이 없습니다.