import time
time.sleep(0.1) # Wait for USB to become ready

import machine, onewire, ds18x20
 
#Change machine pin if blue wire put elsewhere
ds_pin = machine.Pin(16)
ds_sensor = ds18x20.DS18X20(onewire.OneWire(ds_pin))

#Confirmation that Temp Sensor Found
roms = ds_sensor.scan()
print('Found a ds18x20 device')
 
#Loop of sensor converting temp for <1s then printing it
while True:
  ds_sensor.convert_temp()
  time.sleep_ms(750)
  for rom in roms:
    print(ds_sensor.read_temp(rom))
 #Change sleep time if needed to increase/decrease readings
  time.sleep_ms(250)
$abcdeabcde151015202530354045505560fghijfghij
BOOTSELLED1239USBRaspberryPiPico©2020RP2-8020/21P64M15.00TTT