Skip to content

Commit

Permalink
updated Readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Sudipto Aich committed May 15, 2014
1 parent 9ef8292 commit 6bf7bd6
Show file tree
Hide file tree
Showing 31 changed files with 12 additions and 50 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
PixelOpenXC - HelloWord
=====================

A very simple application that connects the pixel board and openxc
A very simple application that connects the [pixel board](http://ledpixelart.com) and [openxc](http://openxcplatform.com)

## Dependencies

**OpenXC Libraries:** The [OpenXC Android
**OpenXC Libraries + Hardware:** The [OpenXC Android
API](https://github.com/openxc/openxc-android) handles all vehicle data
connections. The library includes [installation
instructions](http://openxcplatform.com/android/api-guide.html), example code
and additional documentation in the README file. This library is needed to
access any vehicle data.
access any vehicle data. The application needs the [OpenXC Enabler application for android](https://github.com/openxc/openxc-android), for use in a vehicle it also requires an [OpenXC Vehicle Interface](http://openxcplatform.com/vehicle-interface/hardware.html#ford-reference-design)

**PXEL Board** [PIXEL](http://ledpixelart.com/) is an open-source, interactive framed LED wall display that allows you to send animations and images from an Android device or Windows PC.

**IOIO Libraries** A [version of the IOIO Library](https://github.com/sudipto13/ioio) is used to connect to the board and is adapted from the popular [IOIO-library](https://github.com/ytai/ioio/) f and board provides a host machine the capability of interfacing with external hardware over a variety of commonly used protocols. The original IOIO board has been specifically designed to work with Android devices. The newer IOIO-OTG ("on the go") boards work with both Android devices and PC's (details here). The IOIO board can be connected to its host over USB or Bluetooth, and provides a high-level Java API on the host side for using its I/O functions as if they were an integral part of the client. The [IOIO-wiki](https://github.com/ytai/ioio/wiki) provides further details about setting up the library and troubleshooting.

Expand All @@ -19,3 +21,5 @@ The three libraries required by the Pixel Project are:
- IOIOLibAccessory
- IOIOLibAndroid
- IOIOLibBT

To pair the board with the device turn on the Pixel Board and Bluetooth pair using code : 4545. More instructions on the PixelBoard can be found [here](http://ledpixelart.com/for-developers-2/)
Binary file modified bin/PixelHelloOpenXC.apk
Binary file not shown.
Binary file modified bin/classes.dex
Binary file not shown.
Binary file modified bin/classes/com/pixelart/openxc/pixelopenxc/PixelOpenXC$1.class
Binary file not shown.
Binary file not shown.
Binary file modified bin/classes/com/pixelart/openxc/pixelopenxc/PixelOpenXC$2.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified bin/classes/com/pixelart/openxc/pixelopenxc/PixelOpenXC$3.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified bin/classes/com/pixelart/openxc/pixelopenxc/PixelOpenXC.class
Binary file not shown.
Binary file modified bin/dexedLibs/guava-15.0-68a5094d15156bea338a716a78ceeedb.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified bin/dexedLibs/ioiolibbt-542326f4ce9033fbe2a474bd00491824.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified bin/dexedLibs/openxc-dc3cbdcb1897c2dab8d704b80ba5c49d.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 0 additions & 3 deletions bin/jarlist.cache

This file was deleted.

Binary file modified bin/resources.ap_
Binary file not shown.
49 changes: 5 additions & 44 deletions src/com/pixelart/openxc/pixelopenxc/PixelOpenXC.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,79 +7,48 @@

import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.Timer;

import android.app.AlertDialog;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.IBinder;
import android.preference.PreferenceManager;
import android.util.Log;
//import android.view.WindowManager;
import android.widget.TextView;




//import com.ledpixelart.pixelopenxc.MainActivity.ConnectTimer;
import com.openxc.VehicleManager;
import com.openxc.measurements.BrakePedalStatus;
import com.openxc.measurements.Measurement;
import com.openxc.measurements.UnrecognizedMeasurementTypeException;
import com.openxc.measurements.VehicleSpeed;
import com.openxc.remote.VehicleServiceException;

import android.content.pm.PackageManager.NameNotFoundException;
//import com.openxc.measurements.VehicleSpeed;

public class PixelOpenXC<connectTimer, ConnectTimer> extends IOIOActivity {

private ioio.lib.api.RgbLedMatrix.Matrix KIND; //have to do it this way because there is a matrix library conflict
private android.graphics.Matrix matrix2;
private short[] frame_ = new short[512];
public static final Bitmap.Config FAST_BITMAP_CONFIG = Bitmap.Config.RGB_565;
private byte[] BitmapBytes;
private Bitmap canvasBitmap;
private Bitmap originalImage;
private int width_original;
private int height_original;
private float scaleWidth;
private float scaleHeight;
private Bitmap originalImage;
private Bitmap resizedBitmap;
private int resizedFlag = 0;

private VehicleManager mVehicleManager;
private TextView mVehicleBrakeView;
private TextView mVehicleSpeedView;
private int brakePriority = 3;
private int currentPriority = 0;
private int pixelFound = 0;
// private int pedalTimerRunning = 0;
// private Timer _pedalTimer;
// private double speedDelta;
private InputStream BitmapInputStream;
private ioio.lib.api.RgbLedMatrix matrix_;

private ConnectTimer connectTimer;
private int matrix_model;
private Resources resources = null;
private SharedPreferences prefs;
private String app_ver;
protected static final String tag = "openxc";
private ConnectTimer connectTimer;
protected static final String tag = "openxc";


@Override
Expand All @@ -95,22 +64,13 @@ public void onCreate(Bundle savedInstanceState) {
Intent intent = new Intent(this, VehicleManager.class);
bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
}

resources = this.getResources();
setPreferences();

this.prefs = PreferenceManager.getDefaultSharedPreferences(this);
}

private void setPreferences()
{
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
matrix_model = Integer.valueOf(prefs.getString(
resources.getString(R.string.selected_matrix),
resources.getString(R.string.matrix_default_value)));
KIND = ioio.lib.api.RgbLedMatrix.Matrix.SEEEDSTUDIO_32x32; //v2 as the default, it has 2 IDC connectors
BitmapInputStream = getResources().openRawResource(R.raw.openxcgrey);
// }
frame_ = new short [KIND.width * KIND.height];
BitmapBytes = new byte[KIND.width * KIND.height *2]; //512 * 2 = 1024 or 1024 * 2 = 2048

Expand Down Expand Up @@ -215,7 +175,8 @@ private void showNotFound() {
////************ Create Images to be displayed on the Board ********************/////
private void clearMatrixImage() throws ConnectionLostException {
//let's clear the image
BitmapInputStream = getResources().openRawResource(R.raw.blank); //load a blank image to clear it
// BitmapInputStream = getResources().openRawResource(R.raw.blank); //load a blank image to clear it
BitmapInputStream = getResources().openRawResource(R.raw.openxcgrey);
loadRGB565();
matrix_.frame(frame_);
}
Expand Down

0 comments on commit 6bf7bd6

Please sign in to comment.