Robonon provides articles, tutorials, and other interesting information related to robotics. Learn the basics or embedded systems programming, and have fun with our Arduino projects.
Sunday, July 29, 2012
Project #1.2: Light-Tracking Robotic Arm. Proof of Concept.
So - My initial assumption regarding the amount of C I'd have to learn was a bit overstated. If you're familiar with almost any C based language (Python is a great example), learning to control the Arduino shouldn't be more complicated than spending a couple hours looking over examples on the Arduino Foundations and Reference page. Though I do have to say, the Arduino Cookbook 2nd. Edition is a phenomenal reference. The book not only shows you how to do pretty much anything the Arduino is capable of, but it gives detailed explanations of each sketch (that's Arduino-speak for "program") to provide an understanding of why it's written the way it is.
Before diving in head-first, soldering up components and buying supplies for the arm, I'd like to do some testing. For now I'll focus only on a single axis, this will make life much easier should something not appear to be working properly.
The Setup:
Two Light-Dependent Resistors (LDR), also referred to as photo-resistors, each connected to analog-in pins.
A digital (standard) servo, connected to one of the digital PWM-capable pins.
That's it! I told you the Arduino was going to make this easy on us. Now comes the fun part - writing a sketch to tell the Arduino to compare the voltages of the two LDRs, and sending the servo in one direction or the other, accordingly. The idea is that when light is shining on one side of the "face," the servo will rotate toward the light until the light hitting both LDRs is equal.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment