Created
November 12, 2017 03:19
-
-
Save JosephGregg/a3c05dd6f6f883de456fbdd358486c40 to your computer and use it in GitHub Desktop.
YT-260 Pan/Tilt hack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const byte numChars = 32; | |
char receivedChars[numChars]; // an array to store the received data | |
boolean newData = false; | |
int dataNumber = 0; // new for this version | |
void setup() { | |
pinMode(5, OUTPUT); | |
pinMode(4, OUTPUT); | |
pinMode(0, OUTPUT); | |
pinMode(2, OUTPUT); | |
Serial.begin(115200); | |
Serial.println("<Pan/Tilt Controller>"); | |
Serial.println("Ready!"); | |
} | |
void loop() { | |
recvWithEndMarker(); | |
showNewNumber(); | |
} | |
void recvWithEndMarker() { | |
static byte ndx = 0; | |
char endMarker = '\n'; | |
char rc; | |
if (Serial.available() > 0) { | |
rc = Serial.read(); | |
if (rc != endMarker) { | |
receivedChars[ndx] = rc; | |
ndx++; | |
if (ndx >= numChars) { | |
ndx = numChars - 1; | |
} | |
} | |
else { | |
receivedChars[ndx] = '\0'; // terminate the string | |
ndx = 0; | |
newData = true; | |
} | |
} | |
} | |
void showNewNumber() { | |
if (newData == true) { | |
dataNumber = 0; | |
dataNumber = atoi(receivedChars); | |
if (dataNumber == 1) { | |
Serial.println("Received stop command"); | |
analogWrite(5, 0); | |
analogWrite(4, 0); | |
exit; | |
} | |
else if (dataNumber == 2) { | |
Serial.println("Received rotate left command"); | |
analogWrite(4, 1023); | |
digitalWrite(2, LOW); | |
delay(300); | |
analogWrite(4, 0); | |
} | |
else if (dataNumber == 3) { | |
Serial.println("Received rotate right command"); | |
analogWrite(4, 1023); | |
digitalWrite(2, HIGH); | |
delay(300); | |
analogWrite(4,0); | |
} | |
else if (dataNumber == 4) { | |
Serial.println("Received tilt back command"); | |
analogWrite(5, 1023); | |
digitalWrite(0, HIGH); | |
delay(300); | |
analogWrite(5,0); | |
} | |
else if (dataNumber == 5) { | |
Serial.println("Received tilt forward command"); | |
analogWrite(5, 1023); | |
digitalWrite(0, LOW); | |
delay(300); | |
analogWrite(5,0); | |
} | |
newData = false; | |
} | |
} |
Thanks. This will do it. Excellent.
I forgot to mention the power switch. I used a germanium diode so that there would be no chance for the power switch on the base to damage the PIO driver on the Pi. Also, the 10k resistors are to prevent unintended activation and/or ESD damage.
Thanks.
Also interesting I think...
https://blog.featherbear.cc/post/zifon-yt-1000-wifi-acu/
…On Fri, 20 Jan 2023 at 23:18, jay3702 ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
I forgot to mention the power switch. I used a germanium diode so that
there would be no chance for the power switch on the base to damage the PIO
driver on the Pi. Also, the 10k resistors are to prevent unintended
activation and/or ESD damage.
—
Reply to this email directly, view it on GitHub
<https://gist.github.com/a3c05dd6f6f883de456fbdd358486c40#gistcomment-4444119>
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACKKCKUQ6LNB75XFYNQ7HXLWTMFMVBFKMF2HI4TJMJ2XIZLTSKBKK5TBNR2WLJDHNFZXJJDOMFWWLK3UNBZGKYLEL52HS4DFQKSXMYLMOVS2I5DSOVS2I3TBNVS3W5DIOJSWCZC7OBQXE5DJMNUXAYLOORPWCY3UNF3GS5DZVRZXKYTKMVRXIX3UPFYGLK2HNFZXIQ3PNVWWK3TUUZ2G64DJMNZZDAVEOR4XAZNEM5UXG5FFOZQWY5LFVA4DEOJXGAZTSMFHORZGSZ3HMVZKMY3SMVQXIZI>
.
You are receiving this email because you commented on the thread.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>
.
Yep, that's the way I would do it now. I found this one not long after fully committing to the hardware-hacking approach: https://hackaday.io/project/175096-hacking-yt-500-pan-tilt-head-radio-remote/details
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's the schematic of the whole project. The wiring for the base is in the lower right. I desoldered two pins on each of the motor controller chips so that I could insert the OR gates. They aren't really necessary, I included them so that the buttons on the base and the remote would still work. If you don't care about that functionality, just connect your external controller directly to the motor controller pins after desoldering them and bending them up. Alternatively, you could find a place to cut the traces from the onboard controller to the motor controller chips then wire directly to the motor controller pins without desoldering. Sorry, I don't have any photos.
