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. 

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay