Toggle navigation
Toggle navigation
This project
Loading...
Sign in
이다은
/
raspberry
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
daeun
2021-04-23 14:58:13 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6237eceda21f8661e64c3e2324024e5d153c64d6
6237eced
1 parent
6dc26ffa
a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
midterm4.c
midterm4.c
View file @
6237ece
...
...
@@ -12,7 +12,7 @@ int data[] = { 0,0,0,0,0,0 };
int
state
=
2
;
int
KeypadRead
(){
int
i
,
keypadnum
=
-
1
;
int
keypadnum
=
-
1
;
if
(
!
digitalRead
(
Keypad
[
0
]))
{
keypadnum
=
0
;
state
=
0
;
...
...
@@ -52,6 +52,9 @@ void timer() {
delay
(
1
);
}
}
void
start
()
{
state
=
0
;
}
void
stop
()
{
state
=
1
;
}
...
...
@@ -78,14 +81,16 @@ void init() {
}
int
main
(){
init
();
if
(
wiringPiISR
(
Keypad
[
0
],
INT_EDGE_FALLING
,
&
start
<
0
)
{
return
1
;
}
if
(
wiringPiISR
(
Keypad
[
1
],
INT_EDGE_FALLING
,
&
stop
)
<
0
)
{
return
1
;
}
if
(
wiringPiISR
(
Keypad
[
2
],
INT_EDGE_FALLING
,
&
reset
)
<
0
)
{
return
1
;
}
if
(
!
digitalRead
(
Keypad
[
0
])
&&
state
==
0
)
{
state
=
0
;
if
(
state
==
0
)
{
unsigned
long
prevtime
=
millis
();
while
(
1
)
{
unsigned
long
curtime
=
millis
();
...
...
Please
register
or
login
to post a comment