These blocks are compatible with GPS modules delivering an NMEA 0183 serial data stream. This includes the PAM-7Q (Parallax #28509).
Wiring & Connections
Schematic for the Waveshare NEO-7M-C GPS module and Propeller microcontroller for the example functions below. Wiring may be different for the PAM-7Q or other GPS modules, please see their product guides for specifics.
FLiP Wiring Alert! If using the Propeller FLiP module with a GPS module, use a 3-pin extension cable to provide some distance between the two modules to improve satellite reception and reduce interference.
Quick Code Example
The GPS Data Output Blockly example retrieves longitude, latitude, speed, heading, elevation, and number of satellites from the GPS module. The units are converted to decimal degrees and displayed in the Blockly terminal. The underlying GPS library is compatible with NEMA-formatted GPS strings.
This example features a large number of blocks. We recommend that you download the SVG file containing this pre-arranged program below and append it to your own project, rather than recreate it block-by-block. Want to learn more about downloading/uploading block files into BlocklyProp programs? Read the More BlocklyProp Features section of the Getting Started with Blockly tutorial series. The basics are covered briefly below to get you started.
Follow these instructions to add these blocks to your workspace:
- Open BlocklyProp and log in.
- Unzip the file you just downloaded and make a note of the file location.
- Start a new BlocklyProp project, or open an existing project you want to add these blocks to.
- Save your project, then click on the button with 3 parallel lines on it (furthest top-right on the page).
- Choose "Upload Blocks File".
- Select the file you just unzipped, and click "Replace" to replace your current program with these blocks, or "Append" if you want to add the blocks to your project without deleting any already-existing blocks.
Your workspace should now contain the following program (note that these blocks are displayed in a different layout in this image):