summaryrefslogtreecommitdiff
path: root/grc/examples/xmlrpc/xmlrpc_client_script.py
blob: 956fa07fb76db1369786be6334d9443591b812cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env python

import time
import random
import xmlrpclib

#create server object
s = xmlrpclib.Server("http://localhost:1234")

#randomly change parameters of the sinusoid
for i in range(10):
	#generate random values
	new_freq = random.uniform(0, 5000)
	new_ampl = random.uniform(0, 2)
	new_offset = random.uniform(-1, 1)
	#set new values 
	time.sleep(1)
	s.set_freq(new_freq)
	time.sleep(1)
	s.set_ampl(new_ampl)
	time.sleep(1)
	s.set_offset(new_offset)