diff --git a/robots/little_john/telemetry/code/monitor/colours.pyc b/robots/little_john/telemetry/code/monitor/colours.pyc index 8fa7806..f1639f6 100644 Binary files a/robots/little_john/telemetry/code/monitor/colours.pyc and b/robots/little_john/telemetry/code/monitor/colours.pyc differ diff --git a/robots/little_john/telemetry/code/monitor/graph_plotter.py b/robots/little_john/telemetry/code/monitor/graph_plotter.py index 547fc1f..ba8e827 100755 --- a/robots/little_john/telemetry/code/monitor/graph_plotter.py +++ b/robots/little_john/telemetry/code/monitor/graph_plotter.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 import pyglet import math @@ -6,14 +6,18 @@ import random import time import serial -datafeed = serial.Serial( - port='/dev/ttyUSB0', - baudrate = 9600, - parity=serial.PARITY_NONE, - stopbits=serial.STOPBITS_ONE, - bytesize=serial.EIGHTBITS, - timeout=1 -) +try: + datafeed = serial.Serial( + port='/dev/rfcomm0', + baudrate = 115200, + parity=serial.PARITY_NONE, + stopbits=serial.STOPBITS_ONE, + bytesize=serial.EIGHTBITS, + timeout=1 + ) +except: + print("Serial port setup failure; exiting") + exit() red = [1, 0, 0] green = [0, 1, 0] @@ -33,12 +37,12 @@ def drawgrid(target, xlines, ylines, xlimits, ylimits): for xpos in range(0, target.width, target.width/xlines): pyglet.graphics.draw(2, pyglet.gl.GL_LINES, ('v2i', (xpos, 0, xpos, target.height))) tagtext = str(round((xlimits[1]-xlimits[0])*(float(xpos)/target.width) + xlimits[0], 1)) - tag = pyglet.text.Label(tagtext, font_name='Arkhip', font_size=10, x=xpos-2, y=0, anchor_x='right', anchor_y='bottom') + tag = pyglet.text.Label(tagtext, font_name='Sans', font_size=10, x=xpos-2, y=0, anchor_x='right', anchor_y='bottom') tag.draw() for ypos in range(0, target.width, target.height/ylines): pyglet.graphics.draw(2, pyglet.gl.GL_LINES, ('v2i', (0, ypos, target.width, ypos))) tagtext = str(round((ylimits[1]-ylimits[0])*(float(ypos)/target.height) + ylimits[0], 1)) - tag = pyglet.text.Label(tagtext, font_name='Arkhip', font_size=10, x=0, y=ypos-2, anchor_x='left', anchor_y='top') + tag = pyglet.text.Label(tagtext, font_name='Sans', font_size=10, x=0, y=ypos-2, anchor_x='left', anchor_y='top') tag.draw() @@ -86,7 +90,7 @@ def poll_serial(foo): except: pass -pyglet.clock.schedule_interval(poll_serial, 0.01) +pyglet.clock.schedule_interval(poll_serial, 0.001) def drawgraph(target, xpoints, ypoints, colour): plotline(target, xpoints, ypoints, colour) @@ -102,4 +106,4 @@ def on_draw(): window1.clear() drawgraph(window1, xdata, y1data, green) -pyglet.app.run() \ No newline at end of file +pyglet.app.run() diff --git a/robots/little_john/telemetry/code/robot/analogread_demo/analogread_demo.ino b/robots/little_john/telemetry/code/robot/analogread_demo/analogread_demo.ino index 5e3c258..36e3b52 100644 --- a/robots/little_john/telemetry/code/robot/analogread_demo/analogread_demo.ino +++ b/robots/little_john/telemetry/code/robot/analogread_demo/analogread_demo.ino @@ -7,9 +7,14 @@ */ #include +#include + +SoftwareSerial Bluetooth(3, 2); // Rx, Tx void setup() { Serial.begin(9600); + Bluetooth.begin(115200); + //Bluetooth.print("Hello, wireless world!"); pinMode(13, OUTPUT); } @@ -17,8 +22,8 @@ void loop() { float a0value = analogRead(A0); float a7value = analogRead(A7); - Serial.print(a0value); - Serial.print(", "); - Serial.println(a7value); - delay(20); + Bluetooth.print(a0value); + Bluetooth.print(", "); + Bluetooth.println(a7value); + delay(500); } -- libgit2 0.21.2