You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/micropython/03.micropython/00.first-steps/00.intro-micropython/intro-micropython.md
+3-7Lines changed: 3 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ MicroPython is a lightweight implementation of Python 3 designed to run on micro
10
10
11
11
## MicroPython on Arduino Boards
12
12
13
-
![Placeholder graphic]()
13
+

14
14
15
15
When using MicroPython on Arduino boards, the software is first installed on your Arduino. This allows the board to interpret and run Python code. Once MicroPython is installed on your board (don't worry, we'll cover this [here]()), you can start writing and executing Python scripts instantly.
16
16
@@ -20,7 +20,7 @@ Unlike traditional development approaches, where you compile code and then flash
20
20
21
21
Once MicroPython is installed, you can start programming by writing scripts and uploading them to the board. These scripts are interpreted in real-time, meaning you can make quick changes and see immediate results, streamlining the development process.
22
22
23
-
![TODO: Image of code edit with immediate change]()
23
+

24
24
25
25
MicroPython also includes a simple file system where your scripts are stored. For example, when you write a script, it is saved directly on the board and can be executed immediately without compiling. You can also save other scripts that can be activated from the main script!
26
26
@@ -36,8 +36,6 @@ The MicroPython installation includes several key components:
36
36
37
37
2.**Base Modules**: MicroPython comes with built-in modules for working with hardware like pins, sensors, and communication protocols (I2C, SPI, etc.). This includes essential modules like `machine`, `network`, and `time`.
38
38
39
-
![TODO: A diagram showing how `boot.py` and `main.py` are loaded during the boot process and how they fit into the file system could be useful here.]()
40
-
41
39
## How to Program for MicroPython
42
40
43
41
Programming in MicroPython involves writing Python scripts in a text editor and then running them on your board. For this, we can use the [Arduino Lab for MicroPython]().
@@ -50,8 +48,6 @@ When writing MicroPython code, it's essential to think in terms of **modularity*
50
48
2.**Helper Modules**: Break down your code into smaller modules for specific tasks, such as controlling a sensor or managing a display. These modules can be imported into `main.py` as needed.
51
49
3.**Interrupts and Background Tasks**: If you're dealing with hardware, you may also need to work with interrupts or periodic tasks, which can be handled in dedicated modules.
52
50
53
-
![TODO: A flowchart here could be beneficial to illustrate how to structure a MicroPython project, with `main.py` at the top and helper modules branching off.]()
54
-
55
51
## MicroPython vs. C++ for Electronics Projects
56
52
57
53
MicroPython offers a different approach to programming compared to the traditional C++ used in Arduino development. Here are a few key comparisons:
@@ -60,6 +56,6 @@ MicroPython offers a different approach to programming compared to the tradition
60
56
-**Real-Time Interactivity**: With MicroPython, you can write and test code interactively, without needing to compile. This makes it faster to experiment and troubleshoot hardware setups.
61
57
-**Resource Efficiency**: C++ is more efficient in terms of memory and speed, making it a better option for projects that need to squeeze every bit of performance out of the hardware. MicroPython, on the other hand, prioritizes ease of development over raw performance, but it is still capable of handling many common hardware tasks.
62
58
63
-
![TODO: A side-by-side table comparing typical tasks (like reading a sensor or blinking an LED) in MicroPython and C++ could help illustrate the differences.]()
59
+
## Summary
64
60
65
61
In summary, MicroPython provides a powerful and flexible way to develop electronic projects, especially for those familiar with Python. Its ability to run on microcontrollers like Arduino boards makes it an attractive option for both beginners and experienced developers who want a fast and efficient workflow.
0 commit comments