DEV Community

Cover image for Self-Aligning Dish in Rust: GPS Application
Ian Ndeda
Ian Ndeda

Posted on

Self-Aligning Dish in Rust: GPS Application

We'll now apply the code from our preceding example program to our overall project.

Table of Contents

Requirements

  • 1 x Raspberry Pico board
  • 1 x USB Cable type 2.0
  • 1 x Neo-6M GPS Module
  • 9 x M-M jumper wires
  • 1 x HC-05 Bluetooth Module
  • 2 x Mini Breadboards
  • Serial Bluetooth App

Implementation

We will simply add all the new sections from our previous part in the series, the GPS example, into our continuing project in src/main.rs.

The flow of the program shall be a continuation from the final Command part of the series.

Move the code in examples/gps.rs to src/main.rs and modify the application code in the main loop as per the chart below.

gps-app

In manual mode we should see the particular command we give i.e. Clockwise, Counter Clockwise etc. In auto mode the system should continuously acquire and display GPS data in raw and processed form.

Connections

The electrical connection will be the same as that from the immediate previous part.

gps-conn

Results

This is the final code to be run on the Pico.

Highlights of all the changes from the previous section can be found here.

Flash the application code into the Pico.

At this point our board should be performing a number of functions:

  • It should be blinking regularly 1
  • It should be able to receive commands remotely via Bluetooth
  • It should receive GPS data from the Neo-6M module and acquire look angles from those.

Toggle the board into auto mode and you'll see the GPS raw data, GPS coordinates and look angles printed regularly on the Bluetooth terminal.

gps-app-final

In the next part of this series we'll acquire the magnetic heading of our model satellite dish.


  1. Since we are using a lot of blocking reads and writes, we shall not always have clean 1-second blinks, as they will be at times prevented by a busy function. Some functions, such as transmit_uart_data, block further operations until they are done. 

Top comments (0)