Serial.print("NX:");
Serial.print((int)basicNorth.getX());
Serial.print(", NY:");
Serial.print((int)basicNorth.getY());
Serial.print(", NI:");
Serial.print((int)(basicNorth.getIntensity() * 200 / 127));
Serial.print('\n');
NX:250, NY:130, NI:30’\n’
# skip over the / in the command
cmd = self.path[1:]
# create a list containing the command and all of its parameters
cmd_list = cmd.split('/')
result = ''
if cmd.startswith("poll"):
try:
Data.connection.reset_input_buffer()
string = Data.connection.readline().decode()
temp_list = string.strip().split(',')
value = []
for i in temp_list:
value.append(i.split(':')[1])
result = 'NX ' + value[0] + '\r\n'
result = result + 'NY ' + value[1] + '\r\n'
result = result + 'NI ' + value[2] + '\r\n''
except:
pass
http_response = "HTTP/1.1 200 OK" + '\r\n'
http_response += "Content-Type: text/html; charset=utf-8" + '\r\n'
http_response += "Content-Length" + str(len(result)) + '\r\n'
http_response += "Access-Control-Allow-Origin: *" + '\r\n'
http_response += '\r\n'
if result != '':
Serial.print("NX:");
Serial.print((int)basicNorth.getX());
Serial.print(", NY:");
Serial.print((int)basicNorth.getY());
Serial.print(", NI:");
Serial.print((int)(basicNorth.getIntensity() * 200 / 127));
Serial.print('\n');
NX:250, NY:130, NI:30’\n’
# skip over the / in the command
cmd = self.path[1:]
# create a list containing the command and all of its parameters
cmd_list = cmd.split('/')
result = ''
if cmd.startswith("poll"):
try:
Data.connection.reset_input_buffer()
string = Data.connection.readline().decode()
temp_list = string.strip().split(',')
value = []
for i in temp_list:
value.append(i.split(':')[1])
result = 'NX ' + value[0] + '\r\n'
result = result + 'NY ' + value[1] + '\r\n'
result = result + 'NI ' + value[2] + '\r\n''
except:
pass
http_response = "HTTP/1.1 200 OK" + '\r\n'
http_response += "Content-Type: text/html; charset=utf-8" + '\r\n'
http_response += "Content-Length" + str(len(result)) + '\r\n'
http_response += "Access-Control-Allow-Origin: *" + '\r\n'
http_response += '\r\n'
if result != '':