import iio
import signal
import sys
+import time
n = 0
pressure = 0
@cherrypy.expose
@cherrypy.tools.json_out()
+
def getData(self):
global n
global pressure
global pyro
global battery
+ t = time.localtime()
+ current_time = time.strftime("%Y:%m:%d %H:%M:%S", t)
+
for id in VOLTAGES:
chan = ctrl.find_channel(id)
rawstring = chan.attrs['raw'].value
armed = sense_armed()
return {
+ 'time' : current_time,
'pressure' : pressure,
'thrust' : thrust,
'pyro' : pyro,
var request = $.ajax({'url': '/getData'});
request.done(function(response)
{
+ $('#time').text(response.time);
$('#pressure').text(response.pressure);
$('#thrust').text(response.thrust);
$('#pyro').text(response.pyro);
<body>
<h1>QuantiMotor</h1>
<button>make ajax call</button>
+ <h2>Time</h2>
+ <div id='time'></div>
<h2>Pressure</h2>
<div id='pressure'></div>
<h2>Thrust</h2>