From 2b486a8af6f4bff2dd9782c556284c9a419e4043 Mon Sep 17 00:00:00 2001 From: chrishoder Date: Thu, 28 Feb 2013 19:55:52 +0000 Subject: [PATCH] added diagnostic method git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@1551 12e2690d-a6be-4b82-a7b7-67c4a43b65c8 --- client/FordExperiments.py | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/client/FordExperiments.py b/client/FordExperiments.py index f6cb816..2c9268b 100644 --- a/client/FordExperiments.py +++ b/client/FordExperiments.py @@ -886,10 +886,6 @@ class FordExperiments(experiments): while (time.time()-starttime < .1): self.multiPacketSpit(packet0rts=True) - - - - # read in 26 frames # average them # normalize to our range of values (conversion 1.6167*x-63.5 @@ -901,6 +897,24 @@ class FordExperiments(experiments): #sample width: 2 --> 2 bytes per sample #framerate: 44100 + def engineDiagnostic(self, data): + + self.addFilter([513, 513, 513,513]) + + startTime = tT.time() + while((tT.time() - startTime ) < 15): + packet = None; + + #catch a packet to decode + while (packet == None): + packet=self.client.rxpacket(); + + rpm = 64.5 * ord(packet[5]) - 61.88 + mph = 1.617 * ord(packet[9]) - 63.5 + + data.put("Engine RPM: %d Current Speed: %d mph", %(rpm, mph)) + time.sleep(.5) + -- 2.20.1