I want to read from the DS18B20 one-wire temperature sensor with the arduino uno using python. But I have no clue how to do it. Is there any code/blog for it?
Do you mean you want to?
Or you’ve tried some code and it isn’t working?
Edit: Well, thanks for editing your original post to clarify.
Do you have google or another “search engine” available on your internets?
Give it a whirl, you’ll be amazed.
The UNO is programmed in C++, NOT PYTHON, so you need to program the UNO to read the DS18B20 and output the value using serial.print - you may want to start with a ‘#’ sign, to allow you python code in your other device to know when it starts.
Python is interpreted code, and to interpret it, you need to store roughly 1MB of compiled C-code on your board to execute it. The UNO only has 32kB, it will never fit a Python runtime.
If you insist to do microcontrollers with Python: this is not your forum, here we do things in C++, but I think you shouldn’t do Python on micontrollers anyway. C++ is everything as simple. You either get nuts of missing semicollons, or you get nuts of wrong indentation with spaces. If you still want Python, get a Python capable microncontroller, like the micro:bit v2 or some M0/M4 board by Adafruit.
Do you want to program the Arduino in python, like CircuitPython or MicroPython or did you want a python program on a PC to communicate with an Arduino sketch written in C++?
program the arduino in python
You cannot program a Uno in Python
Lots of Google results for Arduino Python:
But are there any that show you how to program in Python on a Uno ?
@meryem95 appears to want to program a UNO in Python, which seems unlikley, Python runs on PCs and similar.
There are ports of MicroPython that run on things like the ESP32 (not an Arduino) but I dont think there is a port for a UNO. Even Micropython needs large amounts of RAM to operate.
I found somethings about using Python on microcontrollers, everything else was more with.
But the micro they had in mind was substantially more powerful than an UNO.
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.