fixit
This commit is contained in:
parent
49c6460303
commit
16a9bd2f4e
2
main.js
2
main.js
@ -16,7 +16,7 @@ setInterval(function() {
|
|||||||
}, 500);
|
}, 500);
|
||||||
|
|
||||||
function createTimeline() {
|
function createTimeline() {
|
||||||
var chart = new SmoothieChart({grid:{fillStyle:'transparent'}});
|
var chart = new SmoothieChart({grid:{fillStyle:'transparent'}, labels:{fillStyle:'#000000'}});
|
||||||
chart.addTimeSeries(random, { strokeStyle: 'rgba(0, 0, 0, 1)', fillStyle: 'rgba(0, 0, 0, 0.1)', lineWidth: 4 });
|
chart.addTimeSeries(random, { strokeStyle: 'rgba(0, 0, 0, 1)', fillStyle: 'rgba(0, 0, 0, 0.1)', lineWidth: 4 });
|
||||||
chart.streamTo(document.getElementById("chart"), 500);
|
chart.streamTo(document.getElementById("chart"), 500);
|
||||||
}
|
}
|
||||||
|
2
main.py
2
main.py
@ -110,6 +110,8 @@ def stream(dev):
|
|||||||
with serial.Serial(dev, timeout=1) as s:
|
with serial.Serial(dev, timeout=1) as s:
|
||||||
while True:
|
while True:
|
||||||
temperature = s.readline().decode().strip()
|
temperature = s.readline().decode().strip()
|
||||||
|
if not temperature:
|
||||||
|
continue
|
||||||
print("temperature", temperature)
|
print("temperature", temperature)
|
||||||
temps.append(temperature)
|
temps.append(temperature)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user