X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=client%2FFordExperiments.py;h=2baf55133cd6751e49fb8deaba3afbb7eba930fc;hp=357ba6c9030be97c54187cb25dfd5992a2191eca;hb=d08bfd3c7cdc687fd68ba9025702c262665e52d3;hpb=430d7e84b2a1035a6b3137a826563cff796a2412 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)