Skip to content

Crotalid/PanTilt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

PanTilt

This is for control of a Pan Tilt system with two servos and an Arduino Nano BLE Sense Rev2. The C++ code will need to be uploaded to your arduino, and once the arduino is running the code you can find the UUID's/Address with several methods, I just used a bluetooth scanner app. You can then take these and paste them into the Python code. When run, the python program will print that it has succesfully connected and open up a pygame window. If you move your mouse in this window, it will take the coordinates of your mouse and convert it into angles for the pan and tilt servos. I have implemented constraints on one of my servos, as without this, it would crash my thermal camera into the base of my device and risk breaking it. If you do not need this contraint, just delete those lines or modify their values. When you are done, simply hit the escape key and both servos will return to their middle position, which for my set up happens to be 135 degrees, because both of my servos are 270 degrees.
Things to make note of: I used 270 degree servos, and applied constraints to one of them. I also accidentally limited both of the servos to 255 degrees and I don't know how to fix that. My servos also use slightly different pusle width limits than most, so you will likely have to modify some values in the python and arduino code, which shouldn't be too hard if you know what you're doing. Which I don't. So this is far from perfect, in fact I have the Pan and Tilt servos labled incorrectly and I'm to afraid to try and change that. It works so I'm leaving it as is. So use this at your own risk because I don't know what the hell I'm doing. Best of luck, and resist the urge to mount weapons to this.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published