Made it so the config file works on the TableLaptop.py file
This commit is contained in:
parent
da1f8b8d02
commit
705259f0e8
@ -1,15 +1,21 @@
|
||||
from networktables import NetworkTables
|
||||
from time import sleep
|
||||
import configparser
|
||||
|
||||
NetworkTables.initialize()
|
||||
NetworkTables.startServer()
|
||||
|
||||
table = NetworkTables.getTable("PiStatus")
|
||||
config = configparser.ConfigParser()
|
||||
config.read('config.ini')
|
||||
|
||||
table = config.get('settings', 'tables')
|
||||
|
||||
table = NetworkTables.getTable(table)
|
||||
print("Server started, waiting for data...")
|
||||
|
||||
while True:
|
||||
cpu = table.getNumber("CPU Usage", -1)
|
||||
temp = table.getNumber("Temperature", -1)
|
||||
mem = table.getNumber("Memory", -1)
|
||||
print(f"CPU: {cpu}, Temp: {temp} Mem:{mem}")
|
||||
print(f"CPU: {cpu}%, Temp: {temp}C Mem:{mem} MB")
|
||||
sleep(1)
|
||||
|
Loading…
Reference in New Issue
Block a user