Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
DDC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GOKA HARSHITH
DDC
Commits
f313b577
Commit
f313b577
authored
Jun 20, 2016
by
Harshith Goka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Debug done, First working model! (static only)
parent
fb3b938d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
20 deletions
+23
-20
app/src/main/java/com/example/harshith/ddc/Frame.java
app/src/main/java/com/example/harshith/ddc/Frame.java
+4
-4
app/src/main/java/com/example/harshith/ddc/Gesture.java
app/src/main/java/com/example/harshith/ddc/Gesture.java
+3
-3
app/src/main/java/com/example/harshith/ddc/Live.java
app/src/main/java/com/example/harshith/ddc/Live.java
+3
-1
app/src/main/java/com/example/harshith/ddc/ReceiveDataThread.java
...main/java/com/example/harshith/ddc/ReceiveDataThread.java
+13
-12
No files found.
app/src/main/java/com/example/harshith/ddc/Frame.java
View file @
f313b577
...
...
@@ -16,14 +16,14 @@ public class Frame{
}
else
{
upp
erBound
=
lrBound
-
(
index
+
2
)*((
lrBound
-
upBound
)/
levels
);
low
erBound
=
lrBound
-
(
index
+
1
)*((
lrBound
-
upBound
)/
levels
);
low
erBound
=
lrBound
-
(
index
+
2
)*((
lrBound
-
upBound
)/
levels
);
upp
erBound
=
lrBound
-
(
index
+
1
)*((
lrBound
-
upBound
)/
levels
);
}
if
(
index
==
8
){
upperBound
=
up
Bound
;
lowerBound
=
lr
Bound
;
upperBound
=
lr
Bound
;
lowerBound
=
up
Bound
;
}
}
...
...
app/src/main/java/com/example/harshith/ddc/Gesture.java
View file @
f313b577
...
...
@@ -3,11 +3,11 @@ package com.example.harshith.ddc;
public
class
Gesture
{
public
int
dataPoints
=
15
;
public
int
dataPoints
=
50
;
public
int
sensors
=
10
;
public
int
adcLevels
=
2
;
public
int
adcUpper
=
6
0
;
public
int
adcLower
=
2
00
;
public
int
adcUpper
=
0
;
public
int
adcLower
=
1
00
;
public
int
mpuLevels
=
3
;
public
int
mpuUpper
=
18000
;
public
int
mpuLower
=
-
18000
;
...
...
app/src/main/java/com/example/harshith/ddc/Live.java
View file @
f313b577
...
...
@@ -31,7 +31,9 @@ public class Live {
}
public
void
update
(
int
[]
readings
){
reading
=
readings
.
clone
();
for
(
int
i
=
0
;
i
<
sensors
;
i
++){
reading
[
i
]
=
readings
[
i
];
}
}
public
void
print
(){
...
...
app/src/main/java/com/example/harshith/ddc/ReceiveDataThread.java
View file @
f313b577
...
...
@@ -3,6 +3,7 @@ package com.example.harshith.ddc;
import
android.bluetooth.BluetoothSocket
;
import
android.os.Handler
;
import
android.os.Looper
;
import
android.util.Log
;
import
java.io.IOException
;
import
java.io.InputStream
;
...
...
@@ -35,35 +36,35 @@ public class ReceiveDataThread extends Thread {
int
[]
hand
;
int
q
=
0
;
q
=
0
;
hand
=
new
int
[]
{
0
,
0
,
0
,
0
,
0
,
8
,
8
,
8
,
8
,
8
,
8
};
q
=
0
;
hand
=
new
int
[]
{
0
,
0
,
0
,
0
,
8
,
8
,
8
,
8
,
8
,
8
};
// neutral
a
[
q
].
updateFrame
(
hand
);
q
=
1
;
hand
=
new
int
[]
{
1
,
1
,
0
,
0
,
0
,
8
,
8
,
8
,
8
,
1
,
8
};
q
=
1
;
hand
=
new
int
[]
{
1
,
1
,
0
,
0
,
8
,
8
,
8
,
8
,
1
,
8
};
// voice search
a
[
q
].
updateFrame
(
hand
);
q
=
2
;
hand
=
new
int
[]
{
1
,
0
,
1
,
1
,
1
,
8
,
8
,
8
,
8
,
1
,
8
};
q
=
2
;
hand
=
new
int
[]
{
1
,
0
,
1
,
1
,
8
,
8
,
8
,
8
,
1
,
8
};
// tap
a
[
q
].
updateFrame
(
hand
);
q
=
3
;
hand
=
new
int
[]
{
0
,
1
,
1
,
1
,
0
,
8
,
8
,
8
,
8
,
1
,
8
};
q
=
3
;
hand
=
new
int
[]
{
0
,
1
,
1
,
1
,
8
,
8
,
8
,
8
,
1
,
8
};
// call
a
[
q
].
updateFrame
(
hand
);
q
=
4
;
hand
=
new
int
[]
{
0
,
0
,
1
,
1
,
1
,
8
,
8
,
8
,-
1
,
8
,
8
};
q
=
4
;
hand
=
new
int
[]
{
0
,
0
,
1
,
1
,
8
,
8
,
8
,-
1
,
8
,
8
};
// cam open
a
[
q
].
updateFrame
(
hand
);
q
=
5
;
hand
=
new
int
[]
{
0
,
0
,
0
,
1
,
1
,
8
,
8
,
8
,-
1
,
8
,
8
};
q
=
5
;
hand
=
new
int
[]
{
0
,
0
,
0
,
1
,
8
,
8
,
8
,-
1
,
8
,
8
};
// cam click
a
[
q
].
updateFrame
(
hand
);
q
=
6
;
hand
=
new
int
[]
{
1
,
0
,
1
,
1
,
0
,
8
,
8
,
8
,
8
,
1
,
8
};
q
=
6
;
hand
=
new
int
[]
{
1
,
0
,
1
,
1
,
8
,
8
,
8
,
8
,
1
,
8
};
// music open
a
[
q
].
updateFrame
(
hand
);
q
=
7
;
hand
=
new
int
[]
{
0
,
0
,
1
,
1
,
0
,
8
,
8
,
8
,
8
,
1
,
8
};
q
=
7
;
hand
=
new
int
[]
{
0
,
0
,
1
,
1
,
8
,
8
,
8
,
8
,
1
,
8
};
// music play
a
[
q
].
updateFrame
(
hand
);
...
...
@@ -128,14 +129,14 @@ public class ReceiveDataThread extends Thread {
stringBuilder
.
delete
(
0
,
endOfLineIndex
+
2
);
if
(
count
==
no
){
L
.
m
(
"Gesture "
+
gestActive
+
" is activated"
);
L
og
.
d
(
"Gesture"
,
"Gesture "
+
gestActive
+
" is activated"
);
count
=
0
;
gestActive
=
-
1
;
//if( str.equals("n") ) { stay = false; break; }
}
if
(
count
<
no
){
if
(
readings
.
length
==
1
1
)
{
if
(
readings
.
length
==
1
0
)
{
staticLive
.
update
(
readings
);
}
}
...
...
@@ -143,10 +144,10 @@ public class ReceiveDataThread extends Thread {
for
(
int
i
=
0
;
i
<
8
;
i
++)
{
if
(
a
[
i
].
isInFrame
(
staticLive
)){
if
(
gestActive
==
i
){
count
++;
continue
;
count
++;
break
;
}
else
{
gestActive
=
i
;
count
=
1
;
continue
;
gestActive
=
i
;
count
=
1
;
break
;
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment