![]() The Arduino IDE runs on a subset of C++ (or a superset of C). In short, learn some C and the basics of C++ if you like. You would end up having to write a custom library in C, then build a Python library from it, use it, then compile back to C again. And this will be something you use fairly frequently with Arduino, depending on your projects. Arduino programming language can be divided in three main parts: functions, values (variables and constants), and structure. For example, when you learn about C’s volatile keyword, you’ll see that it’s probably not even possible to emulate that functionality with standard Python. If you type a few lines of code, you can be pretty sure they won’t be optimized to do something slightly different. C also has very little magic “behind the scenes”. They have mechanisms purposely exposed for reading from and manipulating hardware registers - which is how you interface with the hardware (like the Arduino). In this case, C and C++ were chosen for the Arduino for a reason. Debugging anything would be an exercise in pain tolerance.Īt the root, the standard python language won’t work so well, largely because you won’t have access to many of the Arduino libraries that are essential for working with the hardware. Your build-test loop will also be horribly ugly. Not to mention you’ll have next to zero support from any community. Arduino is a platform that controls a microcontroller using a. But you’re likely to have a higher learning curve doing that that and learning Arduino specific stuff and the hardware side all at the same time. Programming languages are a precise way of communication between a machine and a programmer. Python can be compiled to C and - at least theoretically - be used in that way for Arduino programming. Note: My knowledge is from 5-6 years ago, things may have changed since then. It can be scary at first, but it is the correct tool for the job. Taking the time to learn the basics of C will be the best way to go here. No, Python will not be suitable for Arduino programming.
0 Comments
Leave a Reply. |