[FICHE] Portage Let's STEAM → STeaMi : Utiliser des boutons-poussoirs #5#134
Open
DumontALINE wants to merge 3 commits into
Open
[FICHE] Portage Let's STEAM → STeaMi : Utiliser des boutons-poussoirs #5#134DumontALINE wants to merge 3 commits into
DumontALINE wants to merge 3 commits into
Conversation
|
Images automagically compressed by Calibre's image-actions ✨ Compression reduced images by 62.1%, saving 1.5 MB.
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new I-Novmicro/STEaMi MicroPython fiche for using push buttons and registers it in the resource catalogue.
Changes:
- Added the new
i10boutons poussoirs fiche. - Added a corresponding
resources.tscatalogue entry. - Included links to STeaMi images and related fiches.
Reviewed changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
site/src/data/resources.ts |
Registers the new push-button fiche in the catalogue. |
site/docs/inovmicro-exao/i10-bouton-poussoirs.md |
Adds the pedagogical fiche content, code example, images, and footer. |
Comments suppressed due to low confidence (1)
site/docs/inovmicro-exao/i10-bouton-poussoirs.md:139
- The footer is missing the required adaptation attribution for ported I-Novmicro fiches; CONVENTIONS.md:370-373 requires crediting the original Let's STEAM fiche in the footer, not just stating the license.
Cette fiche fait partie du projet [I-Novmicro #2 : Action EXAO](/projets/inovmicro-exao). Contenu sous licence [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/deed.fr).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| project: 'inovmicro-exao', | ||
| summary: | ||
| 'Apprendre à utiliser les boutons poussoirs de la STeaMi et les intégrer dans des programmes simples.', | ||
| disciplines: ['informatique', 'technologie'], |
| ## De quoi parle-t-on ? | ||
| Le bouton poussoir est un composant électronique qui permet de faire le lien entre une action physique (appuyer sur le bouton) et une action numérique (envoyer une information à la carte STeaMi). C'est un élément de base pour créer des interfaces physiques, comme des claviers, des télécommandes, ou des jeux interactifs. | ||
|
|
||
| Cette fiche est inspirée d'un projet de lets-steam sur [les boutons poussoirs](https://wiki.labaixbidouille.com/ressources/lets-steam/r1as03-boutons). |
|
|
||
| </div> | ||
|
|
||
| <img src="/img/ressources/inovmicro-exao/i10-boutons-poussoirs/icone.png" alt="<description courte de la fiche>" style={{width: '210px', height: '210px', objectFit: 'contain', flexShrink: 0}} /> |
Comment on lines
+63
to
+67
| alt="Les boutons de la Steami" | ||
| style={{maxWidth: '450px', width: '100%', height: 'auto', borderRadius: '8px', border: '1px solid #eee', boxShadow: '0 2px 8px rgba(0,0,0,0.05)'}} | ||
| /> | ||
| <figcaption style={{fontStyle: 'italic', marginTop: '0.5rem'}}> | ||
| Les boutons de la Steami |
|
|
||
| ## Étape 2 : Programmer | ||
|
|
||
| On va maintenant écrire un programme qui allume la LED verte quand on appuie sur le bouton A, et la LED bleue quand on appuie sur le bouton B. Les 2 boutons ne peuvent pas être appuyés en même temps, et les LED s'éteignent quand on relâche les boutons. |
Comment on lines
+99
to
+100
| A_BUTTON = Pin("A_BUTTON", Pin.IN, Pin.PULL_UP) | ||
| B_BUTTON = Pin("B_BUTTON", Pin.IN, Pin.PULL_UP) |
| Voici comment le programme fonctionne : | ||
| - On définit les pins des LED et des boutons, ainsi qu'une variable `weCanPushIt` pour savoir si on peut appuyer sur les boutons ou pas. | ||
| - On entre dans une boucle infinie pour vérifier en permanence l'état des boutons. | ||
| - Si `weCanPushIt` est `True` et que le bouton A est appuyé (c'est-à-dire que sa valeur est 0), on allume la LED verte et on met `weCanPushIt` à `False` pour éviter que les 2 boutons soient appuyés en même temps. |
|
|
||
| ### Exécution | ||
|
|
||
| - **Test rapide** : lancez le programme depuis votre IDE (typiquement bouton **Run** ▶ ou `F5`). Les valeurs défilent dans la console MicroPython. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Résumé
Type de changement
resources.tsouprojects.tsTest plan
npm run build(danssite/) passe sans erreur ni nouveau warningnpm run typecheckpassenpm run format:check && npm run lint:mdCLAUDE.mdIssues liées