Jack J. Beale

Jack J. BealeJack J. BealeJack J. Beale
Root
C.V.
Projects
  • C++ / Arduino
  • Python/Micro-Python
  • Robots/Drones
  • Photography Portfolio
Server Login

Jack J. Beale

Jack J. BealeJack J. BealeJack J. Beale
Root
C.V.
Projects
  • C++ / Arduino
  • Python/Micro-Python
  • Robots/Drones
  • Photography Portfolio
Server Login
More
  • Root
  • C.V.
  • Projects
    • C++ / Arduino
    • Python/Micro-Python
    • Robots/Drones
    • Photography Portfolio
  • Server Login
  • Sign In
  • Create Account

  • My Account
  • Signed in as:

  • filler@godaddy.com


  • My Account
  • Sign out


Signed in as:

filler@godaddy.com

  • Root
  • C.V.
  • Projects
    • C++ / Arduino
    • Python/Micro-Python
    • Robots/Drones
    • Photography Portfolio
  • Server Login

Account


  • My Account
  • Sign out


  • Sign In
  • My Account

Tilt/Pan Platform Via Joystick

Using two 9 gram Servos, a Joystick, Breadboard Power + Raspberry Pi PICO to control a 3D printed Platform.

Allowing for Granular Pan/Tilt Control of a platform using xyz controls.


Download below contains the code and the libraries used.

Downloads

Pan-Tilt_STLfiles (zip)Download
Pan_Tilt_Joystick (zip)Download

Code/Build

Downloads contain the STL files for the mount as well as the Code + Libraries used / copy the below

#include <Servo.h>  


const int xpin = 28; 

const int ypin = 27; 

const int zpin = 26;  


const int xservo = 17; 

const int yservo = 16;  


int ystate; 

int xstate; 

int zstate; 

int sstate;              


Servo my_xservo;                                //Create servo control object 

Servo my_yservo;                                //Create servo control object  


void setup() { 

pinMode(ypin, INPUT); 

pinMode(xpin, INPUT); 

pinMode(zpin, INPUT); 

my_xservo.attach(xservo);                    //Attaches the servo 

my_yservo.attach(yservo);                    //Attaches the servo 

Serial.begin(9600);                                //Start Serial 

}  


void loop(){  

xstate = analogRead(xpin);                      //Get X State 

ystate = analogRead(ypin);                      //Get Y State

zstate = analogRead(zpin);                      //Get Z State  


Serial.println("X,Y,Z: " + String(xstate) + ", " + String(ystate) + ", " + String(zstate) + ", ""ServoVal: " + String(sstate)); //Outputs to Serial monitor 

delay(10); 


sstate = analogRead(xpin);

sstate = map(sstate, 0, 1023, 0, 90);         //maps the servo values to postion my_xservo.write(sstate);                          //writes the map to the X servo 

delay(15);                                                //allows the servo to catch up  


sstate = analogRead(ypin); 

sstate = map(sstate, 0, 1023, 0, 180);       //maps the servo values to postion my_yservo.write(sstate);                         //writes the map to the Y servo 

delay(15);                                               //allows the servo to catch up 

}


Copyright © 2025 Jack Jeremy Beale - All Rights Reserved.

  • Root
  • Contact Me
  • C.V.
  • Photography Portfolio

Powered by

This website uses cookies.

We use cookies to analyze website traffic and optimize your website experience. By accepting our use of cookies, your data will be aggregated with all other user data.

DeclineAccept