Différences entre versions de « ENG-CANSAT-PICO-HowTo »

De MCHobby - Wiki
Sauter à la navigation Sauter à la recherche
Ligne 89 : Ligne 89 :
  
 
{{ttuto-begin}}
 
{{ttuto-begin}}
 +
 +
{{ttuto
 +
  |label=Getting Started
 +
  |descr=Get Started with MicroPython on Raspberry Pi Pico.
 +
  |img=tlogo-pico-get-started.png
 +
  |url=https://hackspace.raspberrypi.com/books/micropython-pico
 +
}}
  
 
{{ttuto
 
{{ttuto
Ligne 98 : Ligne 105 :
  
 
{{ttuto
 
{{ttuto
   |label=Arduino Yun
+
   |label=Pico debugging
   |descr=Arduino '''Yun''', spécialiste du WIFI et du Net. <font color="red">avec traduction de la librairie en français</font>.
+
   |descr=Debugging using another Picro (PicoProbe)
   |img=tlogo-yun.jpg
+
   |img=tlogo-pico-python-sdk.jpg
   |link=Arduino Yun
+
   |url=https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html#debugging-using-another-raspberry-pi-pico
 
}}
 
}}
 
-- AUSSI AVEC LIEN VERS GITHUB --
 
  
 
{{ttuto
 
{{ttuto
   |label=MOD-Wii-Chuck [UEXT]
+
   |label=Resetting Flash
   |descr=Contrôleur de jeu I2C Wii Nunchuck. Exploiter le sous MicroPython (via port UEXT).
+
   |descr=How to reflash MicroPython on the Pico
   |img=tlogo-mod-wii-nunchuck.png
+
   |img=tlogo-pico-python-sdk.jpg
   |url=https://github.com/mchobby/esp8266-upy/tree/master/modwii
+
   |url=https://www.raspberrypi.com/documentation/microcontrollers/micropython.html#drag-and-drop-micropython
 
}}
 
}}
  

Version du 21 février 2022 à 00:21

MicroPython How To

This section of the tutoriel contains small portion of code explaining how to use digital pins, analog pins, buses and all the fundamentals to control the board with Python code.

Control an output

The onboard LED is tied to the GPIO 25. Here how to control it.

from machine import Pin
led = Pin(25, Pin.OUT)
led.value(1) # Switch on the LED
led.value(0) # Switch off the LED

This will work the same with any GPIO pins.

Input Reading

The onboard LED is tied to the GPIO 25. Here how to control it.

from machine import Pin
x
x
x
x

Analog Reading

The onboard LED is tied to the GPIO 25. Here how to control it.

from machine import Pin
x
x
x
x

PWM Output

The onboard LED is tied to the GPIO 25. Here how to control it.

from machine import Pin
x
x
x
x

Hardware buses

I2C Bus

The onboard LED is tied to the GPIO 25. Here how to control it.

from machine import Pin
x
x
x
x

UART Bus

The onboard LED is tied to the GPIO 25. Here how to control it.

from machine import Pin
x
x
x
x


SPI Bus

The onboard LED is tied to the GPIO 25. Here how to control it.

from machine import Pin
x
x
x
x

Additional tutorials

Anyway, the followings are also goods and complete references.

Getting Started

Tlogo-pico-get-started.png

Get Started with MicroPython on Raspberry Pi Pico.

Pico Python SDK

Tlogo-pico-python-sdk.jpg

A MicroPython environment for RP2040 microcontrollers.

Pico debugging

Tlogo-pico-python-sdk.jpg

Debugging using another Picro (PicoProbe)

Resetting Flash

Tlogo-pico-python-sdk.jpg

How to reflash MicroPython on the Pico

 



Written by Meurisse D. for MCHobby


MCHobby investit du temps et de l'argent dans la réalisation de traduction et/ou documentation. C'est un travail long et fastidieux réalisé dans l'esprit Open-Source... donc gratuit et librement accessible.
SI vous aimez nos traductions et documentations ALORS aidez nous à en produire plus en achetant vos produits chez MCHobby.