CalliopeProjectSim/send_test_data.py
2026-05-13 07:32:16 +02:00

18 lines
439 B
Python

import random
from time import sleep
def data_test(turns):
counter = 0
for i in range(turns):
JSONstr = f'{{ "T" : {counter} , "V" : {random.randint(0, 255)} + }}'
yield JSONstr
counter += 1
sleep(0.1)
def data_test_forever():
counter = 0
while True:
JSONstr = f'{{ "T" : {counter} , "V" : {random.randint(0, 255)} }}'
yield JSONstr
counter += 1
sleep(0.1)