Next? level documentation #19230
Replies: 6 comments 18 replies
-
|
To partly answer my own question I came across a couple of documents entitled the GraftSense Performance Optimization Guide and a similar one for memory optimisation, both in github. Unfortunately they are in Chinese. Does anyone have an English translation of them? Cheers Ian |
Beta Was this translation helpful? Give feedback.
-
You discovered wrong. Strings are immutable. Integer (and floating point) variables are mutable. In my opinion it is worth learning the Python language at a PC with a tutorial before making the transition to microcontrollers. |
Beta Was this translation helpful? Give feedback.
-
|
Hi all, I have realized that there remains a lot to be learned about this topic – at least for me. I suggest to study this carefully: /Folke |
Beta Was this translation helpful? Give feedback.
-
|
Just as an aside here is a recent REPL conversation:
Why is the id changing? What exactly is the id in micropython? According to my Python Pocket Reference it is "id(object) returns the identity integer of object which is unique for the calling process among all existing objects (i.e. its address in memory)" Cheers Ian |
Beta Was this translation helpful? Give feedback.
-
Still different objects may have the same ID. But one can rely on the fact, that objects with the same ID have the same value. How the ID of an object is created depends on the implementation of the Python runtime. |
Beta Was this translation helpful? Give feedback.
-
|
As I've been following this thread I will add my tuppence worth. In CPython, this identity corresponds to the memory address where the object resides: But of course wherever in memory the 27 is stored the id 55 represents that memory location, but we just dont know where (and dont really want to know :) ) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am a hardware engineer with more than 50 years of microprocessor/microelectronic based development under my belt. Back when I started there were no micro controller software engineers. We hardware engineers did all the coding. So I have written lots of code in many assemblers, Forth, Basic, Pascal, Tcl/Tk and C, most of it for real time applications. For me, MicroPython is a true revelation. A high level language that gives you fingertip access to the hardware from the keyboard, without the intervention of an enormously complex IDE, makes it capable of cutting development time and effort in half.
Add to this the ready availability of very cheap microcontrollers with unbelievable quantities of ROM and RAM coupled to powerful peripherals, and embedded system development ought to be a breeze.
But I am struggling the grok Micropython itself. I have a hardware engineer's detailed bottom up view of microcontroller applications and Micropython is clearly written by extremely capable software engineers with a predominantly top down view which is reflected in the documentation (as you would expect because after all Micropython IS a high level language).
But where I struggle is in understanding how best to implement the middle ground, where the nitty gritty hard real time stuff takes place. Even simple things like how to efficiently pass information to/from the foreground and background. I have done a lot of searching and, for example, after frightening myself when I discovered integer variables are immutable ???? I came across small integers and a few more details of the inner workings of Micropython that I feel are essential to being confident I can write code that will work. I also came across quite few computer science terms that I am not familiar. I am used to passing by reference or by values, but it seems you can also pass by assignment (whatever that is) and pass a reference by value.
So, what I am looking for is a more detailed explanation of the lower level aspects of Micropython. I am happy to continue searching and build up my knowledge piecemeal but I just wonder if I am missing a great resource that already covers this.
Cheers
Ian
Beta Was this translation helpful? Give feedback.
All reactions