April 17, 2011

Pick and Place Robot in C

Pick and place robot, which pick and place object form one place to another..
Many engineering students make this robot. Same thing we are going to do with c programming..

Code is very simple. There are four blocks present in code for four different move's of robot..

Image's of the this robot code






 Code:

/*www.mycfiles.com*/
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
void main()
{
int gdriver=DETECT,gmode=0;
initgraph(&gdriver, &gmode, "c:\\tc\\bgi");
line (200,400,500,400);
line (350,400,350,250);
line (350,250,400,200);
line (400,200,475,225);
line (475,225,475,357);
line (495,357,453,357);
line (496,357,496,397);
line (453,357,453,397);
//getch();
//rectangle(453,360,497,397);
circle(475,378,21);
getch();

cleardevice();

line (200,400,500,400);
line (350,400,350,250);
line (350,250,400,200);
line (400,200,475,225);
line (475,225,475,300);
line (495,300,453,300);
line (496,300,496,340);
line (453,300,453,340);
//rectangle(453,303,497,343);
circle(475,321,21);
getch();
cleardevice();

line (200,400,500,400);
line (350,400,350,250);
line (350,250,325,200);
line (325,200,225,200);
line (225,200,225,280);
line (205,280,247,280);
line (204,280,204,320);
line (247,280,247,320);
//rectangle(203,283,247,323);
circle(225,301,21);
getch();
cleardevice();

line (200,400,500,400);
line (350,400,350,250);
line (350,250,325,200);
line (325,200,225,200);
line (225,200,225,280);
line (200,280,250,280);
line (200,280,200,320);
line (250,280,250,320);
//rectangle(203,360,247,395);
circle(225,378,21);
getch();
}


Note: Note: this program will run only on windows xp and previous versions of windows. Reason is windows newer versions are not compatible with turbo c++ 3.0 graphic header files.

Hope you will like this post, Post your comment and queries below... :)

Related Posts :



Categories:

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Related Posts with Thumbnails