As a beginner I read in the top of a Pi Pico program often (example) "from picographics import PicoGraphics, DISPLAY_PICO_EXPLORER or “from machine import ADC”
What does from and import mean? Obviously something is imported out of a module picographics or from a machine. But where do I find picographics and machine .
In the last example ADC is imported from machine. How did the programmer know what he had to import? Is there anywhere a list of possibilities?
I also read sometimes only “import utime” or “import time”
Why not “from xxx import time” ?
Coming back to the first question above: "from picographics import PicoGraphics, DISPLAY_PICO_EXPLORER then I should understand that the program wherein this line is used can handle display.set_pen or display.clear() etc. or are these instructions something else?
There must exist a list of all possible display.xxx be specified and how to use them.
This is because I found an example with at the end :
Display some text
display.text("hello", 0, 0)
That worked, but I liked to exchange “hello” by a variable name A used in that program.
So I changed this line by display.text(A, 0, 0). I know A is not a text and have to find another solution for it.
Thank you. The link to MicroPython - Python for microcontrollers had I not yet visited. It is going to the site Micropython.org. I was focussing on the understanding of Modules. Where can I find/read which Modules are available, so that I am able to know what these Modules can do for me within Micropython and which function or keyword they have available
Example: At the top of a program I read:
from machine import Pin
from time import sleep
This means that machine and time exist as a module and that I can use Pin and sleep as the keywords.
So I need an overview with all available Modules and their keywords with a small example of each keyword how to use them.