Coder un bouton maintenable avec GPIO Zero sur le Raspberry Pi

Coder un bouton maintenable avec GPIO Zero sur le Raspberry Pi

Martin O’Hanlon a travaillé sur la façon d’étendre GPIO Zero et a codé un «bouton de maintien». Cela signifie que vous pouvez coder un bouton physique pour faire une chose sur une pression momentanée et une autre chose lorsque le bouton est maintenu pendant plus d’une durée spécifiée. Espérons que cela sera absorbé dans la bibliothèque principale GPIO Zero à un moment donné. Jusque-là, vous pouvez télécharger le code du blog de Martin.

  • Geekworm 2x20 40 Pin Stacking Female Header Kit for Raspberry Pi 5 / Raspberry Pi 4 / 3B+ / 3B / 2B / B+ / Zero (Zero W) (4 Specifications), Raspberry Pi GPIO Stacking Header/Extender
    Packing List: 2 * 2x20 Female Header (Pin Len: 12mm), 2 * 2x20 Female Header (Pin Len: 10.7mm), 2 * 2x20 Female Header (Pin Len: 5.5mm), 2 * 2x20 Pin Header The 2x20 Pin Header is for Raspberry Pi Zero / Zero W. Material: Insulated plastic, hard metal pin Application: Widely be used in Raspberry Pi DIY project, such as for electronic circuit, PCB circuit board etc. electronic project Stacking header for Raspberry Pi 4, Pi 3, Pi 2, Pi Model B+, Pi A+, Pi Zero, Pi Zero W
  • Header GPIO Raspberry Pi avec Code Couleur
  • Freenove Breakout Board for Raspberry Pi 5 / 4B / 3B+ / 3B / 3A+ / 2B / 1B+ / 1A+ / Zero W/Zero, Terminal Block Hat, GPIO Status LED
    Compatible models -> Raspberry Pi 5 / 4B / 3B+ / 3B / 3A+ / 2B / 1B+ / 1A+ / Zero W / Zero. (Note: NOT compatible with Raspberry Pi 400.) GPIO status LED -> LED on if GPIO outputs/inputs high level, LED off if GPIO outputs/inputs low level. Independent LED -> The status LED is driven by the chip instead of the GPIO so the GPIO will not be affected. Terminal block and header -> Connect to all pins of Raspberry Pi's 40-pin GPIO header, 2.54mm / 0.1in pitch. GPIO name -> The BCM numbering name of each GPIO is printed next to the port.