Skip to content

Instantly share code, notes, and snippets.

@ypelletier
ypelletier / MIDI_OUT_bass_drum.py
Created September 5, 2023 12:20
MIDI OUT avec Raspberry Pi Pico. Mélodie à la basse sur le canal 1, et batterie sur le canal 10.
'''
MIDI OUT avec Raspberry Pi Pico. Mélodie à la basse sur le canal 1, et batterie
sur le canal 10.
Pour plus d'informations:
https://electroniqueamateur.blogspot.com/2023/09/midi-out-avec-le-raspberry-pi-pico.html
'''
@ypelletier
ypelletier / MIDI_OUT_simple.py
Created September 5, 2023 12:10
Simple démonstration d'envoi de messages MIDI par un Raspbery Pi Pico: la note Do4 est jouée pendant 2 secondes avec un son de trompette.
'''
Simple démonstration d'envoi de messages MIDI par un Raspbery Pi Pico:
la note Do4 est jouée pendant 2 secondes avec un son de trompette.
Pour plus d'informations:
https://electroniqueamateur.blogspot.com/2023/09/midi-out-avec-le-raspberry-pi-pico.html
'''
@ypelletier
ypelletier / boussole_autonome.py
Created August 29, 2023 13:55
Magnétomètre - Boussole HMCV5883L relié à un Raspberry Pi Pico Une boussole indiquant le nord est dessinée sur un écran OLED SPI.
'''
Magnétomètre - Boussole HMCV5883L relié à un Raspberry Pi Pico
Une boussole indiquant le nord est dessinée sur
un écran OLED SPI.
'''
from hmc5883l import HMC5883L
import time
import math
@ypelletier
ypelletier / boussole_console.py
Created August 29, 2023 13:53
Module magnétomètre - Boussole HMC5883L relié à un Raspberry Pi Pico L'angle par rapport au nord est affiché dans la console.
'''
Module magnétomètre - Boussole HMC5883L relié à un Raspberry Pi Pico
L'angle par rapport au nord est affiché dans la console.
Plus d'infos:
https://electroniqueamateur.blogspot.com/2023/08/magnetometreboussole-hmc5883l-et.html
'''
from hmc5883l import HMC5883L # https://github.com/SindormirNet/micropython-rp2040-hmc5883l/tree/master
@ypelletier
ypelletier / pico_telecommande_Sony20_py
Created July 24, 2023 18:21
ommunication entre une télécommande à infrarouge Sony (20 bits) et un Raspberry Pi Pico. Un TSOP4838 est branché à la broche GP16 du RP Pico.
'''
Communication entre une télécommande à infrarouge
Sony (20 bits) et un Raspberry Pi Pico. Un TSOP4838 est branché
à la broche GP16 du RP Pico.
Bibliothèque micropython_ir par Peter Hinch:
https://github.com/peterhinch/micropython_ir
Pour plus d'informations, voici l'article détaillé:
https://electroniqueamateur.blogspot.com/2023/07/controler-un-raspberry-pi-pico-avec-une.html
@ypelletier
ypelletier / pico_telecommande_samsung.py
Created July 24, 2023 18:21
Communication entre une télécommande à infrarouge Samsung et un Raspberry Pi Pico. Un TSOP4838 est branché à la broche GP16 du RP Pico.
'''
Communication entre une télécommande à infrarouge
Samsung et un Raspberry Pi Pico. Un TSOP4838 est branché
à la broche GP16 du RP Pico.
Bibliothèque micropython_ir par Peter Hinch:
https://github.com/peterhinch/micropython_ir
Pour plus d'informations, voici l'article détaillé:
https://electroniqueamateur.blogspot.com/2023/07/controler-un-raspberry-pi-pico-avec-une.html
@ypelletier
ypelletier / pico_balance.py
Created July 21, 2023 13:10
Balance Raspberry Pi Pico / HX711
'''
Balance Raspberry Pi Pico / HX711
Pour plus d'informations:
https://electroniqueamateur.blogspot.com/2023/07/peser-des-objets-avec-le-raspberry-pi.html
Ce script utilise le pilote hx711-pico-mpy par Daniel Robertson disponible ici:
https://github.com/endail/hx711-pico-mpy
@ypelletier
ypelletier / pico_promeneurs.py
Created July 18, 2023 12:19
Matrice de LEDs RGB 16 X 16 WS2812B et Raspberry Pi Pico. Quelques pixels colorés déambulent au hasard sur la grille.
'''
Matrice de LEDs RGB 16 X 16 WS2812B et Raspberry Pi Pico
Promeneurs aléatoires
Quelques pixels colorés déambulent au hasard sur la grille
Pour lire l'article complet:
https://electroniqueamateur.blogspot.com/2023/07/matrice-de-leds-rgb-16-x-16-ws2812b-et.html
@ypelletier
ypelletier / pico_lignes_mouvantes.py
Created July 18, 2023 12:11
Matrice de LEDs RGB 16 X 16 WS2812B et Raspberry Pi Pico. Lignes colorées qui se déplacent.
'''
Matrice de LEDs RGB 16 X 16 WS2812B et Raspberry Pi Pico
Lignes colorées qui se déplacent
Pour lire l'article complet:
https://electroniqueamateur.blogspot.com/2023/07/matrice-de-leds-rgb-16-x-16-ws2812b-et.html
Bibliothèque pi pico neopixel:
https://github.com/blaz-r/pi_pico_neopixel
@ypelletier
ypelletier / Pico_PWM_codeur_rotatif.py
Last active July 15, 2023 15:54
Codeur rotatif KY-040 contrôle la luminosité de la LED embarquée d'un Raspberry Pi Pico
'''
On varie l'intensité lumineuse de la LED embarquée du Raspberry Pi Pico
au moyen d'un codeur rotatif.
L'article complet se trouve ici:
https://electroniqueamateur.blogspot.com/2023/07/utilisation-dun-codeur-rotatif-avec-le.html
Ce script nécessite le pilote micropython réalisé par Mike Teachman:
https://github.com/miketeachman/micropython-rotary/tree/master