Introduction: Adafruit Trinket PRO Pan & Tilt

I built this as the first test of my new Adafruit Trinket Pro. This device can be used as a camera pan&tilt but it has many other options. My original intent was to use this as an antenna rotator for satellite antenna. The Trinket Pro has more storage and more pins.

Step 1: What You Need:

1: Adafruit trinket pro.

2: Joystick, I used one from old R/C Airplane remote, this one should work though.

3: Servos, you need 2 of them.

4: Wire.

5: Electrical Tape.

6: Bread Board.

That is All.

Step 2: Setup

You can find a whole tutorial for setting up the trinket on windows and mac can be found here. The trinket is hard to setup because it is not built into the Arduino IDE (Code editor), however it will still work. If you any issues you should skip to step 6.

Step 3: Wiring

To wire the pan & tilt you first need to make these connections:

5v----->the red power strip at the edge of the bread board

G------>the blue power strip at the edge of the bread board

A4----->potentiometer 1 middle lead

A5----->potentiometer 2 middle lead

9------->servo1 yellow or orange wire

11------>servo2 yellow or orange wire

servo1 and 2+> red power strip, red wire

servo1 and 2-> blue power strip,black or brown wire

potentiometer1 and 2 +> red powerstrip

potentiometer1 and 2 -> red blue

Look at the diagram Above For Help.

Step 4: Code!

Above I have added my code. You can download this and then open the IDE. Click File then Open. Find where you saved the code. Then open it. Plug in the trinket and make sure it is in boot loader (red light pulsing) click Upload Button. If uploading is successful you should see text like this at the bottom:

Sketch uses 2,296 bytes (8%) of program storage space. Maximum is 28,672 bytes.

Global variables use 65 bytes of dynamic memory.

If you don't see text like this or you get an error message skip to step 6 for troubleshooting.

When the code uploads and the trinket exits boot loader (red light stops pulsing) you can test the program and edit the variables marked in the program.

Step 5: A Base

As the last step, you need a base. My current base is very simple. I put the servo in the middle of my roll of electrical tape. You could make a more refined base out of foam or wood. Just measure the dimensions of the bottom of the servo and cut a whole that size in whatever material you are making your base out of.

Step 6: Troubleshooting

  1. reread the instruction!
  2. check of you trinket is plugged in if you get an error like this:
    avrdude: Error: Could not find USBtiny device (0x1781/0xc9f)
    avrdude: Error: Could not find USBtiny device (0x1781/0xc9f)

  3. If you have any other error put the error message in the comments and I will try to help!

First Time Authors Contest 2016

Participated in the
First Time Authors Contest 2016

Arduino Contest 2016

Participated in the
Arduino Contest 2016