vault backup: 2026-07-11 16:59:05

This commit is contained in:
John Lyon-Smith
2026-07-11 16:59:05 -07:00
parent b0318f13ae
commit ecb462a16b
82 changed files with 1970 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
---
tags:
- resource
created: 2025-11-06 17:37
---
## Summary
Notes on the use of the [rppal]() crate.
## Notes
### GPIO Pull Up/Pull Down Bias
The `rppal::gpio::InputPin::set_bias` method is used to configure the Raspberry Pi's **built-in pull-up or pull-down resistors** on an input pin. 
You should use `set_bias` when interfacing with digital input sensors or switches that do not have their own external pull-up/pull-down resistors. These internal resistors ensure the input pin has a defined logic level (either high or low) when the external component is disconnected or floating, preventing erratic readings caused by electrical noise. 
| When to Use | Typical Connection | |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| **`Bias::PullUp`** | When the input is connected to ground (GND) to signal a "low" state (e.g., a button connecting the pin to GND). The resistor pulls the pin voltage up to 3.3V by default. | One side of a button to the GPIO pin, the other side to GND. |
| **`Bias::PullDown`** | When the input is connected to 3.3V to signal a "high" state (e.g., a sensor outputting 3.3V). The resistor pulls the pin voltage down to GND by default. | One side of a button to the GPIO pin, the other side to 3.3V. |
| **`Bias::Off`** | When the external circuit already provides a defined logic level (e.g., an active sensor with a strong output signal, or an external pull-up/pull-down resistor is used). | Active sensor output connected directly to the GPIO pin. |
## References