-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain_looper.py
53 lines (42 loc) · 1.21 KB
/
main_looper.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
from dataCollectionInput import get_input
from knn import apply_knn
from wknn import apply_wknn
import rssi
# from animation import
import csv
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib import style
from avrageRSSI import avg_rssi
# def graph():
# style.use('fivethirtyeight')
# fig=plt.figure()
# ax1=fig.add_subplot(1,1,1)
# def animate(i):
# xs=[]
# ys=[]
# data=open("cood.csv")
# for lines in data:
# if len(lines)>1:
# print(lines)
# x,y=lines.split(",")
# xs.append(float(x))
# ys.append(float(y))
# data.close()
# ax1.clear()
# ax1.axis([-8, 8, -10, 8])
# ax1.plot(xs,ys)
# ani = animation.FuncAnimation(fig,animate,interval=1000)
# plt.show()
def looper():
# graph()
# while True:
get_input(rssi)
# knn_output = apply_knn()
avg_rssi()
wknn_output = apply_wknn()
with open('cood.csv', 'a')as file:
writer = csv.writer(file)
# writer.writerow([knn_output[0],knn_output[1]])
writer.writerow([wknn_output[0],wknn_output[1]])
looper()