@@ -0,0 +1,1067 @@
+#!/usr/bin/env python3%0A# coding=utf-8%0A%0Aimport serial%0A%0A%0Aclass EcuCollector():%0A    SENTINEL = b'X'%0A    RESPONSE_LENGTH = 91%0A%0A%0A    def __init__(self, port, baudrate=9600):%0A        self.port = port%0A        self.serial_conn = serial.Serial(port, baudrate)%0A%0A%0A    def get_data(self):%0A        %22%22%22%0A        Reads data from the ECU and returns it in a dictionary.%0A        %22%22%22%0A        self.serial_conn.write(self.SENTINEL)%0A        data = self.serial_conn.read(self.RESPONSE_LENGTH)%0A        results = %7B%0A            'engine_speed': __get_vehicle_speed(data),%0A            'tachometer': __get_engine_speed(data),%0A            'temp': __get_engine_temp(data)%0A        %7D%0A        return results%0A%0A%0Adef __get_engine_speed(data):%0A    %22%22%22 Returns the engine speed in RPM %22%22%22%0A    return data%5B4%5D * 50 + data%5B5%5D%0A%0Adef __get_engine_temp(data):%0A    %22%22%22 Returns the engine temperature in degrees Farenheit %22%22%22%0A    temp_celsius = data%5B7%5D%0A    return (temp_celsius * 1.8) + 32%0A%0Adef __get_vehicle_speed(data):%0A    %22%22%22 Returns the vehicle speed in MPH (as determined by the ECU) %22%22%22%0A    return data%5B27%5D%0A%0A

Add collection class for stealing data from the ECU