# ---------------------------------------------------------------
# GNSS UBX message parsed callback
# ---------------------------------------------------------------
def OnUbloxParsed(msgType, msgItems):
    print(msgType)
    print(msgItems)


# ---------------------------------------------------------------
# GNSS Modules
# ---------------------------------------------------------------

# Power-on the GNSS subsystem
gnss_pwr = Pin('PWR_GNSS', Pin.OUT_OD)
gnss_pwr.high()

# UART configuration of ZED with application buffer
zed1 = UART('ZED1', 115200, rxbuf=0, dma=True)

# ---------------------------------------------------------------
# XBEE Expansions
# ---------------------------------------------------------------

# Power-on the XBEE LP subsystem
xlp_pwr = Pin('PWR_XBEE_LP', Pin.OUT_PP)
xlp_pwr.high()

# Re-direct the XBEE LP subsystem to the MCU
xlp_dir = Pin('XBEE_LP_DIR', Pin.OUT_PP)
xlp_dir.high()
Example #2
0

# ---------------------------------------------------------------
# GNSS NMEA message parsed callback
# ---------------------------------------------------------------
def OnParsedMsg(msgType, msgItems):
    pass


# ---------------------------------------------------------------
# GNSS Modules
# ---------------------------------------------------------------

# Power-on the GNSS subsystem
gnss_pwr = Pin('PWR_GNSS', Pin.OUT_PP)
gnss_pwr.high()

# UART configuration of ZEDs with application buffer
zed1_uart = UART('ZED1', 115200, rxbuf=1024)

# Parser configuration
zed1_uart.parser(UART.ParserNMEA,
                 rxbuf=256,
                 rxcallback=OnNmeaMsg,
                 frcallback=OnParsedMsg)


# Main application process
def app_proc():
    while True:
        # ZED Message processor
Example #3
0
import network
from sty import Pin
from sty import UART
import uasyncio as asyncio

# ---------------------------------------------------------------
# Power-on the XBEE subsystem
# ---------------------------------------------------------------

# XBEE Low Power Socket
xbee_lp_pwr = Pin('PWR_XBEE_LP', Pin.OUT_OD)
xbee_lp_pwr.high()

# XBEE Low Power Direction (XBEE_LP <-> MCU)
xbee_lp_dir = Pin('XBEE_LP_DIR', Pin.OUT_PP)
xbee_lp_dir.high()

# XBEE High Power Direction (XBEE_HP <-> MCU)
xbee_hp_dir = Pin('XBEE_HP_DIR', Pin.OUT_PP)
xbee_hp_dir.high()

# ---------------------------------------------------------------
# GSM Module Communication based socket interface (on XBEE-HP)
# ---------------------------------------------------------------

# Configure the network interface card (GSM)
pwr = Pin('PWR_XBEE_HP', Pin.OUT_OD)
nic = network.GSM(UART('XBEE_HP', 115200, rxbuf=1024, dma=False),
                  pwr_pin=pwr,
                  info=True)
Example #4
0
# ---------------------------------------------------------------
QP1 = Pin('QP1', Pin.OUT_PP)
QP2 = Pin('QP2', Pin.OUT_PP)
QP3 = Pin('QP3', Pin.OUT_PP)
QP4 = Pin('QP4', Pin.OUT_PP)
QP5 = Pin('QP5', Pin.OUT_PP)
QP6 = Pin('QP6', Pin.OUT_PP)

# ---------------------------------------------------------------
# Toogle the outputs
# ---------------------------------------------------------------
print('Outputs are toggling...')
stat = 0
for i in range(10):
    if stat == 1:
        QP1.high()
        QP2.high()
        QP3.high()
        QP4.high()
        QP5.high()
        QP6.high()
        stat = 0
    else:
        QP1.low()
        QP2.low()
        QP3.low()
        QP4.low()
        QP5.low()
        QP6.low()
        stat = 1
    utime.sleep_ms(500)
Example #5
0
# ---------------------------------------------------------------
# On-Board LEDs
# ---------------------------------------------------------------

led1 = sty.LED(1)
led2 = sty.LED(2)
led3 = sty.LED(3)

# ---------------------------------------------------------------
# GNSS Modules
# ---------------------------------------------------------------

# Power-on the GNSS subsystem
gnss_pwr = Pin('PWR_GNSS', Pin.OUT_PP)
gnss_pwr.high()

# UART configuration of ZED
zed1_uart = UART('ZED1', 115200, rxbuf=0)

# ---------------------------------------------------------------
# XBEE Expansions
# ---------------------------------------------------------------

# Power-on the XBEE LP subsystem
xlp_pwr = Pin('PWR_XBEE_LP', Pin.OUT_PP)
xlp_pwr.high()

# Power-on the XBEE HP subsystem
xhp_pwr = Pin('PWR_XBEE_HP', Pin.OUT_PP)
xhp_pwr.high()
Example #6
0
from sty import Pin

# ---------------------------------------------------------------
# Power-On the Modem subsystem of RTK board
# ---------------------------------------------------------------
modem_pwr = Pin('PWR_GSM', Pin.OUT_OD)
modem_pwr.high()

# Console info
print('Modem Power-On')
print('You should see modem serial ports on your PC ;)')