public class MainActivity extends AppCompatActivity {
public static pl.droidsonroids.gif.GifTextView giff,ES1,ES2,ES3,ES4,ES5,ES6;
public static GifView goff;
public static byte Ws;
public SeekBar temp ;
protected void onCreate(Bundle savedInstanceState) {
SD=0;
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
ES1 = findViewById(R.id.es1);
ES2 = findViewById(R.id.es2);
ES3 = findViewById(R.id.es3);
ES4 = findViewById(R.id.es4);
ES5 = findViewById(R.id.es5);
ES6 = findViewById(R.id.es6);
goff = (GifView) findViewById(R.id.gif1);
ES1 = (pl.droidsonroids.gif.GifTextView) findViewById(R.id.es1);
temp= findViewById(R.id.tBar);
temp.setProgress(1);
temp.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
[USER=1021285]@override[/USER]
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
progressChangedValue = progress;
T[0]=(byte)progressChangedValue;
Ws=(byte)progressChangedValue;
tmp.setText(T[0]+" º");
//graphsInit();
//CriticalPointUpdate();
D1[1]=progressChangedValue;
}
[USER=1021285]@override[/USER]
public void onStartTrackingTouch(SeekBar seekBar) {
}
[USER=1021285]@override[/USER]
public void onStopTrackingTouch(SeekBar seekBar) {
Ws=(byte)progressChangedValue;
gifs();
D1[1]=progressChangedValue;
T[0]=(byte)progressChangedValue;
//graphsInit();
//CriticalPointUpdate();
D1[1]=progressChangedValue;
Intent intent = new Intent(MainActivity.this, send.class);
startActivity(intent);
if(buffered[1]==1){
vp1=buffered[3]*256+buffered[4];
//Log.d("vp","vp1 = "+vp1+" ");
}
}
});
try {
/* Open the serial port */
mSerialPort = new SerialPort(new File("/dev/ttyS2"), 9600, 0);
mOutputStream = mSerialPort.getOutputStream();
mInputStream = mSerialPort.getInputStream();
mBuffer = new byte[128];
/* Create a receiving thread */
mReadThread = new ReadThread();/* Create a serial port receiving program */
mReadThread.start();
} catch (SecurityException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}