Variable not defined

1

My code gives me error in a definition of a variable but I think it is declared the variable bits_rx , this variable has the purpose of the result of the conversion:

while(1):

while not radio.available(0):
    time.sleep(1 /100)

receivedMessage= []
radio.read(receivedMessage, radio.getDynamicPayloadSize())


string = ""

for n in receivedMessage:
    string += chr(n)
    ascii=convert_to_ascii(string)
    ascii_aux2=np.array(ascii)
    bits_rx=dec_to_bin(ascii)
    print("Bits(recebidos)=",' '.join('{:04b}'.format(n) for n in ascii))
    erros=np.sum(np.array((bits-bits_rx)!=0, dtype=int))
    print("Erros= ", erros)
    
asked by anonymous 29.09.2017 / 00:56

0 answers