def changeSpeed(ev=None):
        tmp = 'speed'
        global spd
        spd = speed.get()
        data = tmp + str(
            spd
        )  # Change the integers into strings and combine them with the string 'speed'.
        #print 'sendData = %s' % data
        print '\nUser command = ', data
        print "Encrypted command = ", crypto.AES_encrypt(data, key)[2]

        tcpCliSock.send(str(crypto.AES_encrypt(
            data, key)))  # Send the speed data to the server(Raspberry Pi)
 def y_increase(event):
     print '\nUser command = y+'
     print "Encrypted command = ", crypto.AES_encrypt('y+', key)[2]
     tcpCliSock.send(str(crypto.AES_encrypt('y+', key)))
 def x_decrease(event):
     print '\nUser command = x-'
     print "Encrypted command = ", crypto.AES_encrypt('x-', key)[2]
     tcpCliSock.send(str(crypto.AES_encrypt('x-', key)))
 def home_fun(event):
     print '\nUser command = home'
     print "Encrypted command = ", crypto.AES_encrypt('home', key)[2]
     tcpCliSock.send(str(crypto.AES_encrypt('home', key)))
 def stop_fun(event):
     print '\nUser command = stop'
     print "Encrypted command = ", crypto.AES_encrypt('stop', key)[2]
     tcpCliSock.send(str(crypto.AES_encrypt('stop', key)))
 def right_fun(event):
     print '\nUser command = right'
     print "Encrypted command = ", crypto.AES_encrypt('right', key)[2]
     tcpCliSock.send(str(crypto.AES_encrypt('right', key)))
 def backward_fun(event):
     print '\nUser command = backward'
     print "Encrypted command = ", crypto.AES_encrypt('backward', key)[2]
     tcpCliSock.send(str(crypto.AES_encrypt('backward', key)))
 def forward_fun(event):
     print "\nUser command = forward"
     print "Encrypted command = ", crypto.AES_encrypt('forward', key)[2]
     tcpCliSock.send(str(crypto.AES_encrypt('forward', key)))
 def quit_fun(event):
     print "\nShutting down program..."
     top.quit()
     tcpCliSock.send(str(crypto.AES_encrypt('stop', key)))
     tcpCliSock.close()
 def xy_home(event):
     print '\nUser command = xy_home'
     print "Encrypted command = ", crypto.AES_encrypt('xy_home', key)[2]
     tcpCliSock.send(str(crypto.AES_encrypt('xy_home', key)))