# 主題標籤

Button

整理 Button 標籤相關文章與教學,協助你快速找到主題內容。

收錄文章:1 篇

Button 相關文章

← 返回全部文章
第9章Raspberry Pi GPIO Input 實作:按鍵輸入、Pull-up、Pull-down 與 Debounce

第9章Raspberry Pi GPIO Input 實作:按鍵輸入、Pull-up、Pull-down 與 Debounce

本章完整介紹 Raspberry Pi 5 GPIO Input 與按鍵實作,從 Push Button、Normally Open、Floating Input、Internal Pull-up、Pull-down 開始,使用 Python GPIO Zero 的 Button 類別讀取按鍵狀態,實作 is_pressed、wait_for_press、when_pressed、when_released、事件驅動控制與 LED toggle。並深入說明機械按鍵 Contact Bounce、Debounce 與 bounce_time,最後使用兩顆按鍵控制上一章 8 顆 LED 跑馬燈的加速與減速,建立 Raspberry Pi 第一個同時包含 GPIO Input、GPIO Output 與人機互動的完整專案。

閱讀文章