From: chrishoder Date: Thu, 28 Feb 2013 19:55:52 +0000 (+0000) Subject: added diagnostic method X-Git-Url: http://git.rot13.org/?p=goodfet;a=commitdiff_plain;h=2b486a8af6f4bff2dd9782c556284c9a419e4043;hp=a85a44e5c82b4062ba76d7f0137722549ac650fc added diagnostic method git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@1551 12e2690d-a6be-4b82-a7b7-67c4a43b65c8 --- 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) +