loading
2 Comments

Tell us about yourself!

Complete Your Profile
  • Super simple Raspberry Pi 433MHz home automation

    you can also use this to calculate the 1 0 pattern, this goes after the code above pattern = [] for i in range(100): if timedeltas[i]<0.0003: pattern.append(1) elif 0.0003<timedeltas[i]<0.0008: pattern.append(0) elif 0.0008<timedeltas[i]<0.1: pattern.append('space') break # at the first space break print pattern # this includes high and low pattern = pattern[::2] # you only want the odd values ie the high pattern = [str(i) for i in pattern] patternstr = ''.join(pattern) print patternstr

    Really nice instructions!!I added the following code to the end of the receive code to calculate the spaces without zooming on matplotlib as it was giving some hit and miss results on the control of my system. The code is fairly rough as its a Saturday after some beers.. currentvalue= 0changepoints = []timedeltas = []for i in range(len(RECEIVED_SIGNAL[0])):if RECEIVED_SIGNAL[1][i] != currentvalue:try:dt = RECEIVED_SIGNAL[0][i]-changepoints[-1]timedeltas.append(dt)except:pass # for the first one there wont be anything in changepointschangepoints.append(RECEIVED_SIGNAL[0][i])currentvalue = RECEIVED_SIGNAL[1][i]#print timedeltas[0:100]shortlist = []longlist = []spacelist =[]for i in range(100): #i looked at the first 100 changes you could do more if timedeltas[i]<0.0003: # note the valu...see more »Really nice instructions!!I added the following code to the end of the receive code to calculate the spaces without zooming on matplotlib as it was giving some hit and miss results on the control of my system. The code is fairly rough as its a Saturday after some beers.. currentvalue= 0changepoints = []timedeltas = []for i in range(len(RECEIVED_SIGNAL[0])):if RECEIVED_SIGNAL[1][i] != currentvalue:try:dt = RECEIVED_SIGNAL[0][i]-changepoints[-1]timedeltas.append(dt)except:pass # for the first one there wont be anything in changepointschangepoints.append(RECEIVED_SIGNAL[0][i])currentvalue = RECEIVED_SIGNAL[1][i]#print timedeltas[0:100]shortlist = []longlist = []spacelist =[]for i in range(100): #i looked at the first 100 changes you could do more if timedeltas[i]<0.0003: # note the values here were from experimentation... bit of lazy coding shortlist.append(timedeltas[i])elif 0.0003<timedeltas[i]<0.0008:longlist.append(timedeltas[i])elif 0.0008<timedeltas[i]<0.1:spacelist.append(timedeltas[i])print shortlistprint longlistprint spacelistprint sum(shortlist)/len(shortlist),sum(longlist)/len(longlist),sum(spacelist)/len(spacelist)

    View Instructable »