Something like this I would guess -How to send script output to pico ?
Code:
#!/usr/bin/env python3import osimport serialimport timedef GetTemperatureC(): s = os.popen("vcgencmd measure_temp").read() return s[s.find("=") + 1:].strip()comPort = serial.Serial \ ( port = "/dev/ttyACM0", baudrate = 115200, parity = serial.PARITY_NONE, stopbits = serial.STOPBITS_ONE, bytesize = serial.EIGHTBITS )while True: comPort.write(bytes(GetTemperatureC() + "\n", "ascii")) time.sleep(1)
Statistics: Posted by hippy — Thu Jun 27, 2024 1:51 pm