Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2021-1-capstone-design1
/
JSH_Project3
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
기상윤
2021-06-14 17:21:02 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1b6d5b992bd76b1dc79d58995ef4292dc63a97d0
1b6d5b99
1 parent
9bbfe0ca
Upload new file
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
code/PADMOTOR.ino
code/PADMOTOR.ino
0 → 100644
View file @
1b6d5b9
int
Mosfet1
=
7
;
// 펠티어 연결 모스펫 7번포트
int
Mosfet2
=
6
;
// 모터 연결 모스펫 6번포트
char
data
;
// 데이터 입력 종류
void
setup
()
{
Serial
.
begin
(
9600
);
pinMode
(
Mosfet1
,
OUTPUT
);
pinMode
(
Mosfet2
,
OUTPUT
);
}
void
loop
()
{
if
(
Serial
.
available
()
>
0
)
// 입력된 데이터가 있다면
{
data
=
Serial
.
read
();
// 데이터에 입력값 넣기
}
if
(
data
==
'f'
)
// f를 입력했을 경우 펠티어 모스펫 on
{
digitalWrite
(
Mosfet1
,
HIGH
);
}
else
if
(
data
==
'd'
)
// d를 입력했을 경우 펠티어 모스펫 off
{
digitalWrite
(
Mosfet1
,
LOW
);
}
else
if
(
data
==
's'
)
// s를 입력했을 경우 모터 on
{
digitalWrite
(
Mosfet2
,
HIGH
);
}
else
if
(
data
==
'a'
)
// a를 입력했을 경우 모터 off
{
digitalWrite
(
Mosfet2
,
LOW
);
}
}
Please
register
or
login
to post a comment