DEV Community

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

Posted on

Self-Aligning Satellite Dish in Rust: Pan Application

In this part we'll implement the relays we tested in the previous example in the project.

Table of contents

Requirements

  • 1 x Raspberry Pico board
  • 1 x USB Cable type 2.0
  • 1 x HC-05 Bluetooth module
  • 1 x HMC5833L Compass Module
  • 40 x M-M Jumper Wires
  • 2 x Mini Breadboards
  • 2 x SG90 Servo Motor
  • 1 x PTZ Kit
  • 1 x GPS Module
  • 2 x Relay modules
  • 2 x 4.2V Li-ion Batteries
  • 1 x DC-DC Step-down Converter
  • 1 x Diode

Implementation

Connections

relays-app-setup

❗ At this point the number of components used has grown so that the computer's USB port may not sufficiently provide power. An external power supply is therefore necessary. I used two 4.2V Li-ion 78000mAh batteries with a DC-DC converter.

Pan

Copy the pan function ,relay initialization pins and the sio handle under the loop's critical section from the previous example to the project.

Under the manual arm of the loop when the direction is selected as clockwise or counterclockwise we want to be able to pan appropriately.

For clockwise direction:

pan(&mut delay, sio.as_mut().unwrap(), Direction::Cw);
Enter fullscreen mode Exit fullscreen mode

For counterclockwise direction:

pan(&mut delay, sio.as_mut().unwrap(), Direction::Ccw);
Enter fullscreen mode Exit fullscreen mode

Results

This will be our updated code.

After flashing and running the program in the Pico, sending the CW command from the Bluetooth Terminal App should pan the PTZ kit clockwise and CCW counterclockwise.

relays-app-results

In the next part of the project we'll finalize on the logic of the application.

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

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