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:19:33 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d3bf038aea1ab50f4447a80b22bacddf4844de96
d3bf038a
1 parent
9a9fec67
Upload new file
Show 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 @
d3bf038
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