Skip to content

Instantly share code, notes, and snippets.

@albertomagana
albertomagana / gist:23d2135cc47a5a5667d9
Created February 10, 2016 01:49 — forked from archeg/gist:8333021
Example of code that uses HID for Android to connect to the device through USB.
package com.company.app.PlatformMethods;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Set;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
Sensor | Address | Data Min | Data Max | Function | Sample
=============================================================================================================================
Accel Enrichment 0x1D 0x01 == 0% 0xFF == 100% y = 100(x/255) %
Coolant Temp 0x07 0x01 == 307deg F 0xFF == -62deg F y = -1.45x + 308 deg F
Engine Speed 0x21 0x01 == 31 0xFF == 7969 y = 31.25x rpm
Fuel Trim High 0x0E 0x01 == 1% 0xFF == 199% y = .78x %
Fuel Trim Low 0x0C 0x01 == 1% 0xFF == 199% y = .78x %
Fuel Trim Middle 0x0D 0x01 == 1% 0xFF == 199% y = .78x %
Injector Pulse Width 0x29 0x01 == .256ms 0xFF == 65.3ms y = .256x ms
Oxygen Feedback Trim 0x0F 0x01 == 1% 0xFF == 199% y = .78x %