From: chrishoder Date: Tue, 12 Feb 2013 03:46:35 +0000 (+0000) Subject: played around with different inputs to change the temperature display X-Git-Url: http://git.rot13.org/?p=goodfet;a=commitdiff_plain;h=d08bfd3c7cdc687fd68ba9025702c262665e52d3;ds=sidebyside played around with different inputs to change the temperature display git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@1480 12e2690d-a6be-4b82-a7b7-67c4a43b65c8 --- diff --git a/client/FordExperiments.py b/client/FordExperiments.py index 357ba6c..2baf551 100644 --- a/client/FordExperiments.py +++ b/client/FordExperiments.py @@ -11,6 +11,7 @@ from intelhex import IntelHex; import Queue import math +tT = time class FordExperiments(GoodFETMCPCANCommunication): def init(self): @@ -138,7 +139,7 @@ class FordExperiments(GoodFETMCPCANCommunication): if(packet1 != None): packetParsed = self.client.packet2parsed(packet1) - recieveTime = time.time() + #recieveTime = time.time() return packetParsed @@ -167,11 +168,17 @@ class FordExperiments(GoodFETMCPCANCommunication): packet[0],packet[1],packet[2],packet[3],packet[4],packet[5],packet[6],packet[7]] packetCount = 1; self.client.txpacket(packet); - tpast = time.time() - while( (time.time()-recieveTime) < runTime): - dt = tpast - time.time() - value = 30*math.sin(((2.0*math.pi)/5.0)*dt)+130 - packet[5] = int(value) + startTime = tT.time() + while( (tT.time()-startTime) < runTime): + dt = tT.time()-startTime + inputValue = ((2.0*math.pi)/20.0)*dt + value = 30*math.sin(inputValue)+130 + print value + #packet[5] = int(value) + if( value > 130 ): + packet[5] = 160 + else: + packet[5] = 100 #packet[6] = 1 print packet self.client.txpacket(packet) @@ -187,4 +194,4 @@ if __name__ == "__main__": runTime = 100; #fe.mimic1056(packetData, runTime) #fe.cycledb1_1056(runTime) - fe.oscillateTemperature(runTime) \ No newline at end of file + fe.oscillateTemperature(runTime)