This commit is contained in:
2025-04-19 23:06:54 +02:00
parent e4663df500
commit 05abcca6f5
5 changed files with 143 additions and 59 deletions

View File

@@ -6,8 +6,13 @@ import pandas as pd
from argparse import ArgumentParser
from tqdm.auto import tqdm
from config import MILLIS_UUID, WEIGHT_UUID
READING_TIME = 30
async def read_ble(reading_time=READING_TIME):
device = await BleakScanner.find_device_by_name("Smaage")
assert device is not None, "No device found"
timestamps = []
raw_weights = []
@@ -45,3 +50,11 @@ async def read_ble(reading_time=READING_TIME):
print(df['weights'].describe())
plt.plot(timestamps, raw_weights)
plt.show()
if __name__ == '__main__':
parser = ArgumentParser()
parser.add_argument('-t', default=READING_TIME, type=int, help="reading time in sec")
args = parser.parse_args()
asyncio.run(read_ble(args.t))