Android Open Source - android-arduino-bricks Dual Motor View






From Project

Back to project page android-arduino-bricks.

License

The source code is released under:

MIT License

If you think the Android project android-arduino-bricks listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package org.hbabcock.btc;
/*  w ww.  ja  v  a 2s.co m*/
import android.content.Context;
import android.util.AttributeSet;

//
// Designed to be used as a super-class.
//
// Sub-classes:
//   DualMotorNormal
//   DualMotorRotated
//
public class DualMotorView extends SingleMotorView {
  
  protected int mSign2 = 0;
    protected int mMotorId2 = 0;
    
  public DualMotorView(Context context, AttributeSet attrs) {
    super(context, attrs);
  }
  
  //
  // motorId1 - which motor, 0 - 7.
  // sign1 - motor direction, 0 = "forward", 1 = "backward".
  // motorId2 - which motor, 0 - 7.
  // sign2 - motor direction, 0 = "forward", 1 = "backward".
  //
  public void configure(int motorId1, int sign1, int motorId2, int sign2){
    mMotorId1 = motorId1;
    mSign1 = sign1;
    mMotorId2 = motorId2;
    mSign2 = sign2;
  }

    protected void stop(BluetoothIO bluetoothIO){
      bluetoothIO.stopMotor(mMotorId2);
      super.stop(bluetoothIO);
    }

}




Java Source Code List

org.hbabcock.btc.BluetoothIO.java
org.hbabcock.btc.DeviceListActivity.java
org.hbabcock.btc.DualMotorNormal.java
org.hbabcock.btc.DualMotorRotated.java
org.hbabcock.btc.DualMotorView.java
org.hbabcock.btc.HorizontalSingleMotorSlider.java
org.hbabcock.btc.MainActivity.java
org.hbabcock.btc.MainFragment.java
org.hbabcock.btc.SingleFragmentActivity.java
org.hbabcock.btc.SingleMotorView.java
org.hbabcock.btc.VerticalSingleMotorSlider.java