Modifications

Sauter à la navigation Sauter à la recherche
569 octets ajoutés ,  7 mars 2022 à 14:16
Ligne 15 : Ligne 15 :     
Here follows some fundamentals help links about the Python language himself:
 
Here follows some fundamentals help links about the Python language himself:
* [https://www.w3schools.com/python/ '''W3Schools''' on Python] : one of the best resource for learning online.
+
* [https://www.w3schools.com/python/ '''W3Schools''' on Python] : one of the best ressource for learning online (should I say "my favorite one).
 
* [https://www.pythoncheatsheet.org/#Python-Basics '''P'''ython'''C'''heat'''S'''heet.org] : Anyone can forget how to make loop, list, dictionary, tuple, list slice, math operator, generator...
 
* [https://www.pythoncheatsheet.org/#Python-Basics '''P'''ython'''C'''heat'''S'''heet.org] : Anyone can forget how to make loop, list, dictionary, tuple, list slice, math operator, generator...
 
* [https://www.pythonsheets.com/ pythonsheets.com] : more advanced cheat sheet.
 
* [https://www.pythonsheets.com/ pythonsheets.com] : more advanced cheat sheet.
Ligne 114 : Ligne 114 :  
That method returns a 16 bits value, so a number between 0 and 65535.
 
That method returns a 16 bits value, so a number between 0 and 65535.
   −
{{ambox|text=Even if the {{fname|read_u16()}} returns a 16 bits values, the effective ADC resolution is still 12 bits. The MicroPython internal will just upscale the ADC value from 0..4095 to returned value 0..65535 by applying a multiplier.}}
+
{{ambox|text=Even if the {{fname|read_u16()}} returns a 16 bits values, the effective ADC resolution is still 12 bits. The MicroPython internal will just upscale the ADC value from 0..4095 to returned value 0..65535 by applying a multiplier.  
 +
 
 +
The effective ADC reading precision is 3.3V/4095 = 0.000805V (0.8mv) }}
    
[[Fichier:ENG-CANSAT-FEATHER-PICO-HowTo-25.png]]
 
[[Fichier:ENG-CANSAT-FEATHER-PICO-HowTo-25.png]]
Ligne 232 : Ligne 234 :  
</syntaxhighlight>
 
</syntaxhighlight>
    +
Outside of connecting device (like GPS) to the UART, you can also use an UART to get the REPL over it (exactly like USB connexion but over an UART. This may be kindly useful to bring a REPL connectivity over mobile network/device.
 +
 
The following snip of code duplicates the REPL over the {{fname|UART(0)}} .
 
The following snip of code duplicates the REPL over the {{fname|UART(0)}} .
   Ligne 239 : Ligne 243 :     
uart = UART(0, baudrate=19200, bits=8, parity=None, stop=1)
 
uart = UART(0, baudrate=19200, bits=8, parity=None, stop=1)
os.dupterm( uart, 1 )
+
os.dupterm( uart, 1 ) # Pico Firmware must be recompile with dupterm()
 
</syntaxhighlight>
 
</syntaxhighlight>
   Ligne 246 : Ligne 250 :  
The {{fname|dupterm()}} function is [https://docs.micropython.org/en/latest/library/os.html#terminal-redirection-and-duplication described here into the MicroPython documentation].
 
The {{fname|dupterm()}} function is [https://docs.micropython.org/en/latest/library/os.html#terminal-redirection-and-duplication described here into the MicroPython documentation].
   −
{{underline|Tips & Tricks:}}<br />One of the key parameter of UART is the {{fname|timeout}} parameter which indicates the timeout (in ms) to receive the end-of-line on {{fname|UART.readline()}} .
+
{{underline|Tips & Tricks:}}
 +
* One of the key parameter of UART is the {{fname|timeout}} parameter which indicates the timeout (in ms) to receive the end-of-line on {{fname|UART.readline()}} .
 +
* See this [https://forums.raspberrypi.com/viewtopic.php?t=304410 Raspberry-Pi forum thread] to compile a dupterm() enabled firmware for Pico.
    
=== SPI Bus ===
 
=== SPI Bus ===
Ligne 263 : Ligne 269 :  
* SS: Slave Select (activated at LOW) used to activate the device on the bus. It is also used to start "transaction" with the device.  
 
* SS: Slave Select (activated at LOW) used to activate the device on the bus. It is also used to start "transaction" with the device.  
    +
[[Fichier:ENG-CANSAT-PICO-HowTo-SPI.png]]
    
The following snip of code creates an instance of the {{fname|SPI(0)}} bus
 
The following snip of code creates an instance of the {{fname|SPI(0)}} bus
29 922

modifications

Menu de navigation