Skip to content

Commit 88f6a8e

Browse files
committed
Update digital-io.md
1 parent 755c248 commit 88f6a8e

File tree

1 file changed

+11
-11
lines changed
  • content/micropython/03.micropython/01.basics/00. digital-io

1 file changed

+11
-11
lines changed

content/micropython/03.micropython/01.basics/00. digital-io/digital-io.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
---
2-
3-
featured: micropython-101
4-
title: '2. Micropython Basics - Digital I/O'
5-
description: 'Learn the basics for loops on MicroPython.'
2+
title: 'Digital I/O'
3+
description: 'Learn about digital I/O with MicroPython.'
64
author: 'Pedro Lima'
7-
hero_image: "./hero-banner.png"
8-
5+
tags: [MicroPython, Digital I/O]
96
---
107

118
Digital pins are fundamental for interacting with the physical world using your Arduino board. In this chapter, we'll explore how to use digital pins in MicroPython to:
@@ -18,15 +15,19 @@ Digital signals have two distinct values:
1815
- **HIGH (1)**: Represents a voltage level close to the board's operating voltage (e.g., 3.3V or 5V).
1916
- **LOW (0)**: Represents a voltage level close to 0V (ground).
2017

21-
Although they can only represent two states, digital signals are highly useful. Being binary in nature, they directly interface with microcontrollers and processors, making them ideal for tasks requiring fast, on/off communication, such as reading sensors or controlling simple outputs. Their simplicity also gives them a natural resilience to electrical noise, as noise only disrupts digital signals when it is strong enough to cross the threshold between HIGH and LOW states. This makes them reliable for clear, consistent communication in various environments.
18+
Although they can only represent two states, digital signals are highly useful. Being binary in nature, they directly interface with microcontrollers and processors, making them ideal for tasks requiring fast, on/off communication, such as reading sensors or controlling simple outputs. Their simplicity also gives them a natural resilience to electrical noise, as noise only disrupts digital signals when it is strong enough to cross the threshold between HIGH and LOW states. This makes them reliable for clear, consistent communication in various environments, compared to analog signals.
19+
20+
## Requirements
21+
22+
2223

2324
## Digital Outputs
2425

25-
To control digital outputs in MicroPython, we use the `Pin` class from the `machine` module. Setting a pin as an output allows you to control devices like LEDs, relays, or other actuators.
26+
To control digital outputs in MicroPython, we use the `Pin` class from the `machine` module. Setting a pin as an output allows us to control devices like LEDs, relays, or other actuators.
2627

27-
### Code Example: Blinking an LED
28+
## Code Example: Blinking an LED
2829

29-
Let's create the classic "Blink" example, where we turn an LED on and off at regular intervals.
30+
For this exercise, we will use the "Blink" example, where we turn an LED on and off at regular intervals.
3031

3132
**Components Needed:**
3233

@@ -72,7 +73,6 @@ while True:
7273
- The loop repeats indefinitely, causing the LED to blink.
7374

7475

75-
7676
## Digital Inputs
7777

7878
Reading digital inputs allows your program to respond to external events, like button presses or sensor signals. In MicroPython, we use the `Pin` class to set up pins as inputs, and we can specify pull modes to stabilize the input readings.

0 commit comments

Comments
 (0)