Modifications

Sauter à la navigation Sauter à la recherche
97 octets ajoutés ,  3 novembre 2025 à 21:52
Ligne 86 : Ligne 86 :  
The [https://github.com/mchobby/cansat-belgium-micropython/blob/main/test-gps/minimaltest.py minimal test] script:
 
The [https://github.com/mchobby/cansat-belgium-micropython/blob/main/test-gps/minimaltest.py minimal test] script:
 
* Opens and configure the UART (serial port) of the Pico
 
* Opens and configure the UART (serial port) of the Pico
−
* Create a GPS object (attached to the UART).
+
* Create a GPS object (attached to the UART)
−
* Wait the GPS to get a Network Fix (NMEA protocol returns the Fix status)
+
* Send some command to the GPS to configure it.
−
* Display useful information from the GPS
+
* Start an infinite {fname|while}} loop to print measurement each seconds
 +
* Wait the GPS to get a Network Fix (NMEA protocol returns the Fix status)
 +
* Display useful information from the GPS
 +
 
 
<syntaxhighlight lang="python">
 
<syntaxhighlight lang="python">
 
from machine import UART, Pin
 
from machine import UART, Pin
Ligne 95 : Ligne 98 :  
from adafruit_gps import GPS
 
from adafruit_gps import GPS
   −
# Pyboard (TX=X9, RX=X10)
   
uart = UART( 0, rx=Pin(1), tx=Pin(0), baudrate=9600, timeout=3000)
 
uart = UART( 0, rx=Pin(1), tx=Pin(0), baudrate=9600, timeout=3000)
−
 
+
gps = GPS(uart) # Create the GPS object
−
# Create a GPS instance
  −
gps = GPS(uart)
      
# Turn on the basic GGA and RMC info
 
# Turn on the basic GGA and RMC info
32 908

modifications

Menu de navigation