def METHOD_NAME():
    """thread worker function"""
    global working, analogReadPollingPins
    x = 0
    working = True
    while(working):
        x = x + 0.09
        y = int(math.cos(x) * 100 + 150)
    	# retcmd = "publishPin/" + str(pin) + "/3/"+ str(y) +"\n"
    	# uart.write(codec.encode(retcmd))
    	for pinx in digitalReadPollingPins:
    	  retcmd = "publishPin/" + str(pinx) + "/0/"+str(randint(0,1))+"\n"
    	  uart.write(codec.encode(retcmd))
    	for pinx in analogReadPollingPins:
    	  #retcmd = "publishPin/" + str(pinx) + "/4/"+ str(y) +"\n"
    	  #retcmd = "publishPin/" + str(pinx) + "/" + str(int(pinx)%4) + "/"+ str(y) +"\n"
    	  retcmd = "publishPin/" + str(pinx) + "/1/"+ str(y) +"\n"
    	  uart.write(codec.encode(retcmd))
    	sleep(0.001)
    	#print (y)
    	# TODO -------
    	# if (digitalReadPollingPins.length() == 0 && analogReadPollingPins.length() == 0
    	# working = False
    print("I am done !")