Raspberry Pi Pico can store all the programs that we have been writing in it. It’s an equivalent function to the microSD card in your Raspberry Pi, or the hard drive or solid-state drive in your laptop or desktop computer, which means that whatever you save there stays in place even when you unplug your Pico’s micro USB cable.
In this video, we will read and log the internal temperature sensor data on Raspberry Pi Pico into a .txt file. Watch this video to know more about it.
This is the list of items used in the video.
|sensor_temp = machine.ADC(machine.ADC.CORE_TEMP)|
|conversion_factor = 3.3 / (65535)|
|file = open("temps.txt", "w")|
|reading = sensor_temp.read_u16() * conversion_factor|
|temperature = 27 – (reading – 0.706)/0.001721|
|file.write(str(temperature) + "\n")|
Thanks for reading this tutorial. If you have any technical inquiries, please post at Cytron Technical Forum.
“Please be reminded, this tutorial is prepared for you to try and learn.
You are encouraged to improve the code for better application.“