Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5439

General • Re: How to measure the RPI 0w's temperature using the PI Pico ?

$
0
0
How to send script output to pico ?
Something like this I would guess -

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



Viewing all articles
Browse latest Browse all 5439

Trending Articles