This Arduino project is the culmination of several smaller projects. The robotic arm first initializes to a 'home' position. From there it scans the table top using the Pixy camera for a preset signature. I would have liked to pan the entire table top but due to time constraints I opted to reduce the pan and scan to objects only in the field of view of the Pixy camera. The 'pixy.blocks[0].y' value determines how far the object is from the base, or in other words the target coordinates. These coordinates are used in the Inverse Kinematics (IK) function to calculate the angles required to place the gripper above the object. Next, the MPU6050 module levels the energized magnet into place. A 'while(true)' statement continuously lowers until is taps the object (a metal disk wrapped in colored tape). This triggers an interrupt which only sets the pan variable to false allowing to break out of the 'while(true)' statement. Lastly, the robotic arm is raised to a predetermined position and then releases the object by turning the magnet off and returning to the 'home' position to start the entire routine over again.
Side Notes:
I mentioned in the video that I used pin 8 as an interrupt pin...it should be pin 18.
I said the robotic arm was 6 DOF but should be 5 DOF.
File Name: Final_IK_Pan_Interrupt_3.ino
Download the file here:
http://www.mediafire.com/file/3e3p8qo...
I hope you enjoyed my video. Please leave a comment, like and subscribe.
Thx, Scot