Changeset 41c4762 in orbit
- Timestamp:
- 11/22/12 15:55:01 (10 years ago)
- Branches:
- master, RawEEG, Raw_EEG_Plot, Servo, Tab_Interface, pyramid
- Children:
- 6aa182f, 1a53973
- Parents:
- 60b4520
- Location:
- android
- Files:
-
- 1 added
- 7 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
android/src/info/puzzlebox/orbit/MainActivity.java
r60b4520 r41c4762 23 23 import android.hardware.usb.UsbManager; 24 24 import android.view.Gravity; 25 import android.view.Menu;26 import android.view.MenuItem;25 //import android.view.Menu; 26 //import android.view.MenuItem; 27 27 import android.view.View; 28 28 import android.widget.Button; … … 31 31 import android.widget.TextView; 32 32 import android.widget.Toast; 33 import android.support.v4.app.NavUtils;33 //import android.support.v4.app.NavUtils; 34 34 import android.text.Layout; 35 35 import android.text.method.ScrollingMovementMethod; … … 80 80 81 81 SerialDevice serial; 82 //int serialBaudRate = 9600;83 int serialBaudRate = 133333;82 int serialBaudRate = 9600; 83 // int serialBaudRate = 133333; 84 84 85 85 -
android/src/info/puzzlebox/orbit/SerialDevice.java
r60b4520 r41c4762 18 18 class SerialDevice extends AsyncTask<String, Void, String> { 19 19 20 int device_frame_cycle = 21; // 22ms frame cycle for Blade mCX2 (MLP4DSM RC) 20 // int device_frame_cycle = 21; // 22ms frame cycle for Blade mCX2 (MLP4DSM RC) 21 // int device_frame_cycle = 500; // 0.5s frame cycle for Arduino 22 int device_frame_cycle = 1000; // 1s frame cycle for Arduino 21 23 boolean keep_running = true; 22 24 private UsbSerialDriver mSerialDevice; 23 25 // TextView tv; 24 26 25 byte[] commandNeutral = {0x00, 0x00, 0x00, (byte) 0xaa, 0x05, (byte) 0xff, 0x09, (byte) 0xff, 0x0d, (byte) 0xff, 0x13, 0x54, 0x14, (byte) 0xaa}; 26 byte[] commandHover = {0x00, 0x00, 0x01, 0x7d, 0x05, (byte) 0xc5, 0x09, (byte) 0xde, 0x0e, 0x0b, 0x13, 0x54, 0x14, (byte) 0xaa}; 27 byte[] commandMaximumThrust = {0x00, 0x00, 0x03, 0x54, 0x05, (byte) 0xc5, 0x09, (byte) 0xde, 0x0e, 0x0b, 0x13, 0x54, 0x14, (byte) 0xaa}; 27 // byte[] commandNeutral = {0x00, 0x00, 0x00, (byte) 0xaa, 0x05, (byte) 0xff, 0x09, (byte) 0xff, 0x0d, (byte) 0xff, 0x13, 0x54, 0x14, (byte) 0xaa}; 28 // byte[] commandHover = {0x00, 0x00, 0x01, 0x7d, 0x05, (byte) 0xc5, 0x09, (byte) 0xde, 0x0e, 0x0b, 0x13, 0x54, 0x14, (byte) 0xaa}; 29 // byte[] commandMaximumThrust = {0x00, 0x00, 0x03, 0x54, 0x05, (byte) 0xc5, 0x09, (byte) 0xde, 0x0e, 0x0b, 0x13, 0x54, 0x14, (byte) 0xaa}; 30 31 String commandNeutral = "x000"; 32 // String commandHover = "x085"; 33 String commandHover = "x085\r"; 34 String commandMaximumThrust = "x100"; 28 35 29 36 String command = "neutral"; … … 31 38 protected String doInBackground(String... buffers) { 32 39 String response = ""; 33 byte[] setting = commandNeutral; 34 40 // byte[] setting = commandNeutral; 41 // String setting = commandNeutral; 42 String setting = commandHover; 43 35 44 while (keep_running) { 36 45 … … 43 52 } 44 53 45 46 54 if (mSerialDevice != null) { 47 55 48 56 try { 49 //mSerialDevice.write(setting, 1000); 50 mSerialDevice.write(setting, device_frame_cycle); 57 mSerialDevice.write(setting.getBytes(), device_frame_cycle); 51 58 } catch (IOException e) { 52 59 // TODO Auto-generated catch block
Note: See TracChangeset
for help on using the changeset viewer.