Commit f313b577 authored by Harshith Goka's avatar Harshith Goka

Debug done, First working model! (static only)

parent fb3b938d
......@@ -16,14 +16,14 @@ public class Frame{
}
else{
upperBound = lrBound - (index+2)*((lrBound-upBound)/levels);
lowerBound = lrBound - (index+1)*((lrBound-upBound)/levels);
lowerBound = lrBound - (index+2)*((lrBound-upBound)/levels);
upperBound = lrBound - (index+1)*((lrBound-upBound)/levels);
}
if(index == 8){
upperBound = upBound;
lowerBound = lrBound;
upperBound = lrBound;
lowerBound = upBound;
}
}
......
......@@ -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 = 60;
public int adcLower = 200;
public int adcUpper = 0;
public int adcLower = 100;
public int mpuLevels = 3;
public int mpuUpper = 18000;
public int mpuLower = -18000;
......
......@@ -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(){
......
......@@ -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");
Log.d("Gesture","Gesture " + gestActive + " is activated");
count = 0;
gestActive = -1;
//if( str.equals("n") ) { stay = false; break; }
}
if(count<no){
if(readings.length == 11) {
if(readings.length == 10) {
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;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment