You are on page 1of 23

send data using gprs

unsigned char s1[9]="AT\r\n"; //send "AT" command modem will response


unsigned char s2[18]="AT+CIPMODE=0\r\n";//Select TCPIP Application mode
unsigned char s3[30]="AT+CLPORT=\"TCP\",\"5000\"\r\n"; //set Local Port
unsigned char s4[45]="AT+CIPCSGP=1,\"airtelgprs.com\"\r\n";//set csd or GPRS for
Connection mode "ur GPRS provide address"
unsigned char s5[15]="AT+CSTT\r";//Start Task and set apn
unsigned char s6[15]="AT+CIICR\r";//Bring up wireless connection with GPRS or CS
D
unsigned char s7[15]="AT+CIFSR\r"; // Get Local Ip Address "is assign for GPRS M
odem"
code unsigned char s8[50]="AT+CIPSTART=\"TCP\",\"10.3.0.100\",\"5000\"\r\n"; //
Start Up TCP or Udp Connection you need to specify your IP of server
unsigned char s9[15]="AT+CIPSEND\r\n"; //Send Datat Through TCP or UDP Connectio
n
unsigned char sd[46]="193308950\r\n"; /
obstacle avoidance
#include "mbed.h"
#include "motordriver.h"
Serial pc(USBTX, USBRX);
Motor A(p23, p5, p6, 1); // pwm, fwd, rev, can brake
Motor B(p22, p30, p29, 1); // pwm, fwd, rev, can brake
AnalogIn p(p18);
int main() {

while(1)
{

A.speed(1);
B.speed(1);
pc.printf("%f",p.read());

if(p.read()>=0.5)
{


pc.printf("detected");

A.speed(0);
B.speed(1);
wait(1.6);
A.speed(-1);
B.speed(1);
wait(2.5);
A.speed(-1);
B.speed(0);
wait(1.6);
A.speed(-1);
B.speed(1);
wait(4.6);
A.speed(-1);
B.speed(0);
wait(1.6);
A.speed(-1);
B.speed(1);
wait(2.5);

A.speed(0);
B.speed(1);
wait(1.6);

A.speed(0);
B.speed(0);

A.speed(-1);
B.speed(1);
wait(1.6);
}
}
}
predefined map
#include "mbed.h"
#include "motordriver.h"
#include "Servo.h"
void interrupt(void);
Servo myservo(p23);
Serial pc(USBTX, USBRX);
Motor A(p21, p5, p6, 1); // pwm, fwd, rev, can brake
Motor B(p22, p7, p8, 1); // pwm, fwd, rev, can brake
AnalogIn us(p15);
float threshold=0.05;
int mid=15,last=30;
float a[60];
int count1=0,count2=0;
int main()
{
while(1)
{
for(float p=0.0 ; p<1.0; p += 0.1)
{
myservo = p;
if (us.read()<threshold)
{
A.speed(0);
B.speed(0);
interrupt();
}
wait(0.099);

}
for(float p=0.9; p>0.0; p -= 0.1)
{
myservo = p;
if (us.read()<threshold)
{
A.speed(0);
B.speed(0);
interrupt();
}
wait(0.099);
}
}
}
void interrupt()
{
myservo.calibrate(.002, 360);
int j=0;
for(float p=0.0 ; p<1.0; p += 0.1)
{

a[j]=us.read();
wait(.2);
pc.printf("\t\n\r %f",us.read());
myservo = p;
wait(0.099);
}


for(int i=0;i<mid;i++)
{
if(a[i]>threshold)
count1++;
}
for(int i=mid+1;i<last;i++)
{
if(a[i]>threshold)
count2++;
}
if(count1<count2)
{
A.speed(0);
B.speed(1);

pc.printf("\n\tturning right");
}
else
{
A.speed(1);
B.speed(0);

pc.printf("\n\n\n\r\tturning left");
}

}


project
#include "mbed.h" //header file
#include "Servo.h" // for servo motor
#include "motordriver.h" // for mtotr driver
void KNM(void);
void RESTROOM(void);
void STAIRS(void);
void MEDICAL_ELECTRONICS(void);
void START(int);
Serial pc(USBTX, USBRX);
Motor A(p21 ,p5, p6 ,1); // pwm, motor input A, motor input B, can brake
Motor B(p22 ,p7, p8 ,1);
Motor C(p23 ,p9, p10 ,1);
Motor D(p24 ,p11, p12 ,1);
Servo myservo(p25); // servo i/o pin
AnalogIn u(p15); // ultrasonic sensor pin
LocalFileSystem local("local");
int n[10];
char m[10];
int i=0;
int c ;
int main()
{
myservo.calibrate(0.004,45) ;
pc.printf("\rPress\n\r\t1 for KNM room \n\r\t2 for STAIRS\n\r\t3 for RESTROO
M\n\r\t4 for MEDICAL ELECTRONICS ROOM\n\r");

pc.scanf("%d",&c);
START(c);
}
void START(int c)
{
switch(c)
{
case (1):
KNM();
break;
case (2):
STAIRS();
break;
case (3):
RESTROOM();
break;
case (4):
MEDICAL_ELECTRONICS();
break;
}
}
void KNM() //KNM file read and
direct
{
FILE *fp = fopen("/local/KNM_DIRECTION.csv", "r"); // open the file in 'read' m
ode

// while not end of file
c=fgetc(fp); // get a character/byte from the
file
printf("Read from file %02x\n\r",c); // and show it in hex format
fclose(fp);
}
void STAIRS() //STAIRS file read a
nd direct
{
FILE *fp = fopen("/local/STAIRS_DIRECTION.csv", "r");
i=0;
while (!feof(fp))
{
m[i]=fgetc(fp);
i++;
}
fclose(fp);
fp = fopen("/local/STAIRS_VALUE.csv", "r");
i=0;
while (!feof(fp))
{
n[i]=fgetc(fp);
i++ ;
}
fclose(fp);
for(i=0;i<3;i++)
{
pc.printf("\t\r\n%c\t%d",m[i],n[i]);
}
}
void RESTROOM() //RESTROOM
file read and direct
{
FILE *fp = fopen("/local/RESTROOM_DIRECTION.csv", "r");
i=0;
while (!feof(fp))
{
m[i]=fgetc(fp);
i++;
}
fclose(fp);
fp = fopen("/local/RESTROOM_VALUE.csv", "r");
i=0;
while (!feof(fp))
{
n[i]=fgetc(fp);
i++ ;
}
fclose(fp);
for(i=0;i<3;i++)
{
pc.printf("\t\r\n%c\t%d",m[i],n[i]);
}
}
void MEDICAL_ELECTRONICS()
//MED_ELEC file read and direct
{
FILE *fp = fopen("/local/MED_ELEC_DIRECTION.csv", "r");
i=0;
while (!feof(fp))
{
m[i]=fgetc(fp);
i++;
}
fclose(fp);
fp = fopen("/local/MED_ELEC_VALUE.csv", "r");
i=0;
while (!feof(fp))
{
n[i]=fgetc(fp);
i++ ;
}
fclose(fp);
for(i=0;i<3;i++)
{
pc.printf("\t\r\n%c\t%d",m[i],n[i]);
}
}
serial communication
#include "mbed.h"

Serial pc(USBTX, USBRX); // tx, rx
AnalogIn s1(p18);
int main()
{
float x,y;
while(1)
{
x=s1.read();
y=x*330;

pc.printf("%f\t",y);
wait(1);
pc.printf("%f\t",y);
wait(1);
}
}
servo
#include "mbed.h"
#include "Servo.h"
Servo myservo(p22);
void func1();
void func2();
int main()
{

myservo.calibrate(.002, 360);
while(1){
for(float p=0.0 ; p<1.0; p += 0.1) {
myservo = p;
wait(0.099);
}


for(float p=0.9; p>0.0; p -= 0.1) {
myservo = p;
wait(0.099);
}}
}
servo 123
#include "mbed.h"
#include "Servo.h"
Servo myservo(p21);
Serial pc(USBTX, USBRX);
int main() {
printf("Servo Calibration Controls:\n");
printf("1,2,3 - Position Servo (full left, middle, full right)\n");
printf("4,5 - Decrease or Increase range\n");
float range = 0.0005;
float position = 0.5;

while(1) {
switch(pc.getc()) {
case '1': position = 0.0; break;
case '2': position = 0.5; break;
case '3': position = 1.0; break;
case '4': range += 0.0001; break;
case '5': range -= 0.0001; break;
}
printf("position = %.1f, range = +/-%0.4f\n", position, range);
myservo.calibrate(range,60);
myservo = position;
}
}
static map
#include "mbed.h"
Serial pc(USBTX, USBRX); // USING HOST COMP AS IPUT AND SIMULATION
char k[4]={'F','5','L','3'};
char r[4]={'F','8','L','4'};
char s[4]={'R','8','L','6'};
char me[4]={'L','9','F','9'};
int main()
{
pc.printf("\rPress '1' for KNM room , '2' for restroom, '3' for stairs, '4' for
med electronics room\n\r");
int c ;
pc.scanf("%d",&c);

switch(c)
{
case 1:

pc.printf("MOVING TOWARDS KNM ROOM\n\r");// output on host
pc using hyper terminal
wait(1);
pc.printf("MOVING %c%c\n\r",k[0],k[1]);
wait(1);
pc.printf("MOVING %c%c\n\r",k[2],k[3]);
wait(1);
pc.printf("destination reached\n\r");
break;

case 2:


pc.printf("MOVING TOWARDS RESTROOM\n\r");// output on hos
t pc using hyper terminal
wait(1);
pc.printf("MOVING %c%c\n\r",r[0],r[1]);
wait(1);
pc.printf("MOVING %c%c\n\r",r[2],r[3]);
wait(1);
pc.printf("destination reached\n\r");
break;

case 3:

pc.printf("MOVING TOWARDS STAIRS\n\r");// output on host
pc using hyper terminal
wait(1);
pc.printf("MOVING %c%c\n\r",s[0],s[1]);
wait(1);
pc.printf("MOVING %c%c\n\r",s[2],s[3]);
wait(1);
pc.printf("destination reached\n\r");
break;

case 4:


pc.printf("MOVING TOWARDS MEDICAL ELECTRONICS ROOM\n\r");
// output on host pc using hyper terminal
wait(1);
pc.printf("MOVING %c%c\n\r",me[0],me[1]);
wait(1);
pc.printf("MOVING %c%c\n\r",me[2],me[3]);
wait(1);
pc.printf("destination reached\n\r");
break;
default:
pc.printf("ENTER A VALID INPUT\n\r");

}
}
static map excel
#include "mbed.h"
Serial pc(USBTX, USBRX); // FOR SERIAL COMMUNICATION VIA
PC
LocalFileSystem local("local"); // Create the local filesystem
under the name "local"
char e,f; //GLOBAL DECLARATION OF VARIABL
ES
int a,b;
float m;
FILE *fr1;
int path;
char c[5];
int main()
{

fr1= fopen("/local/E.csv", "w"); //for scanning direction
if(fr1==NULL)

pc.printf("error");

fprintf(fr1,"2\n");
fprintf(fr1,"F146\n");
fprintf(fr1,"L73\n");
fclose(fr1);
}
motor driver
/*motor driver libary modified from the following libary,
*
* mbed simple H-bridge motor controller
* Copyright (c) 2007-2010, sford
*
* by Christopher Hasler.
*
* from sford's libary,
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "motordriver.h"
#include "mbed.h"
Motor::Motor(PinName pwm, PinName fwd, PinName rev, int brakeable):
_pwm(pwm), _fwd(fwd), _rev(rev) {
// Set initial condition of PWM
_pwm.period(0.001);
_pwm = 0;
// Initial condition of output enables
_fwd = 0;
_rev = 0;
//set if the motor dirver is capable of braking. (addition)
Brakeable= brakeable;
sign = 0;//i.e nothing.
}
float Motor::speed(float speed) {
float temp = 0;
if (sign == 0) {
_fwd = (speed > 0.0);
_rev = (speed < 0.0);
temp = abs(speed);
_pwm = temp;
} else if (sign == 1) {
if (speed < 0) {
_fwd = (speed > 0.0);
_rev = (speed < 0.0);
_pwm = 0;
temp = 0;
} else {
_fwd = (speed > 0.0);
_rev = (speed < 0.0);
temp = abs(speed);
_pwm = temp;
}
} else if (sign == -1) {
if (speed > 0) {
_fwd = (speed > 0.0);
_rev = (speed < 0.0);
_pwm = 0;
temp = 0;
} else {
_fwd = (speed > 0.0);
_rev = (speed < 0.0);
temp = abs(speed);
_pwm = temp;
}
}
if (speed > 0)
sign = 1;
else if (speed < 0) {
sign = -1;
} else if (speed == 0) {
sign = 0;
}
return temp;
}
// (additions)
void Motor::coast(void) {
_fwd = 0;
_rev = 0;
_pwm = 0;
sign = 0;
}
float Motor::stop(float duty) {
if (Brakeable == 1) {
_fwd = 1;
_rev = 1;
_pwm = duty;
sign = 0;
return duty;
} else
Motor::coast();
return -1;
}
float Motor::state(void) {
if ((_fwd == _rev) && (_pwm > 0)) {
return -2;//braking
} else if (_pwm == 0) {
return 2;//coasting
} else if ((_fwd == 0) && (_rev == 1)) {
return -(_pwm);//reversing
} else if ((_fwd == 1) && (_rev == 0)) {
return _pwm;//fowards
} else
return -3;//error
}
/*
test code, this demonstrates working motor drivers.
Motor A(p22, p6, p5, 1); // pwm, fwd, rev, can break
Motor B(p21, p7, p8, 1); // pwm, fwd, rev, can break
int main() {
for (float s=-1.0; s < 1.0 ; s += 0.01) {
A.speed(s);
B.speed(s);
wait(0.02);
}
A.stop();
B.stop();
wait(1);
A.coast();
B.coast();
}
*/
#include "motordriver.h"
#include "mbed.h"
#include "obstacle_scan.h"
DigitalIn ol(p19);
void obstacle_scan_class::obstacle_scan_func()
{
Serial pc(USBTX, USBRX);
Motor A(p23, p5, p6, 1); // pwm, fwd, rev, can brake
Motor B(p22, p30, p29, 1); // pwm, fwd, rev, can brake
pc.printf("\n\r\tobstacle detetcted A\n");
A.stop(1);
B.stop(1);
count=0;
A.speed(1); // moving right
B.speed(-1);
x=35;
y=20;
o=50;


while(count<=y)
{
while(ol.read())
{}
count++;
pc.printf("\n\r\t%d",count);
while(!(ol.read()))
{}
}

A.stop(1);
B.stop(1);
count=0;
wait(0.5);

A.speed(1); // moving right staright
B.speed(1);

while(count<=x)
{
while(ol.read())
{}
count++;
pc.printf("\n\r\t%d",count);
while(!(ol.read()))
{}
}

A.stop(1);
B.stop(1);

count=0;
wait(0.5);

A.speed(-1); // moving left
B.speed(1);

while(count<=16)
{
while(ol.read())
{}
count++;

pc.printf("\n\r\t%d",count);
while(!(ol.read()))
{}
}

A.stop(1);
B.stop(1);

count=0;
wait(0.5);

A.speed(1); // moving left staright
B.speed(1);

while(count<=o)
{
while(ol.read())
{}

count++;
pc.printf("\n\r\t%d",count);
while(!(ol.read()))
{}
}

A.stop(1);
B.stop(1);

count=0;
wait(0.5);
A.speed(-1); // movingleft
B.speed(1);


while(count<=y)
{
while(ol.read())
{}

count++;
pc.printf("\n\r\t%d",count);
while(!(ol.read()))
{}
}

A.stop(1);
B.stop(1);

count=0;
wait(0.5);

A.speed(1); // moving left staright
B.speed(1);

while(count<=x)
{
while(ol.read())
{}

count++;
pc.printf("\n\r\t%d",count);
while(!(ol.read()))
{}
}

A.stop(1);
B.stop(1);
wait(0.5);
count=0;
A.speed(1); // moving right
B.speed(-1);


while(count<=y)
{
while(ol.read())
{}

count++;
pc.printf("\n\r\t%d",count);
while(!(ol.read()))
{}
}

A.stop(1);
B.stop(1);



wait(0.5);


}
xbee
#include "mbed.h"
DigitalOut myled(LED1);
int main() {
while(1) {
myled = 1;
wait(0.2);
myled = 0;
wait(0.2);
}
}
code debugging
#include "motordriver.h"
#include "code_debugging.h"
#include "mbed.h"
#include "directions.h"
#include "row_column_calc.h"
#include "obstacle_avoiding.h"
void code_debugging_class::code_debugging_func(char code, int start, int destina
tion)
{
Serial pc(USBTX, USBRX);
begin=start;
destinatio=destination;

move(code);

return;
}
void code_debugging_class::move(char code) // for code
{
Serial pc(USBTX, USBRX);

directions_class directions_object;


switch(code)
{
case'R':

pc.printf("\n\r\tmoving right");
directions_object.right();
break;
case'L':
pc.printf("\n\r\tmoving left");
directions_object.left();
break;
case'Z':
pc.printf("\n\r\tturning back");
directions_object.back();
break;
case'n':
//char code_char=code;
//int code_int= code_char - '0';
pc.printf("\n\r\tmoving n distance");
directions_object.straight(75);
break;
case 'A':
destination(0);
break;
case 'B':
destination(1);
break;
case 'C':
destination(2);
break;
case 'D':
destination(3);
break;
case 'E':
destination(4);
break;
case 'F':
destination(5);
break;
case 'G':
destination(6);
break;
case 'H':
destination(7);
break;
case 'I':
destination(8);
}
return;
}
void code_debugging_class::destination(char code) // for destination
{

int_code=char_int(code);
Serial pc(USBTX, USBRX);
pc.printf("\n\r\tfound another destination");
LocalFileSystem local("local");
FILE *fr1;

row_column_calc_class row_column_calc_object;
row_column_calc_object.row_column_calc_func(begin,int_code);
int cell=row_column_calc_object.cell;



fr1= fopen("/local/TEST_1.XLS", "r"); //for scanning direction
char a[10];
char b[10];
for(int i=0;i<cell;i++)
fscanf(fr1,"%s\t,",&a);
fscanf(fr1,"%s,",&b);
fclose(fr1);

for(int i=0;b[i]!=0;i++)
code_debugging_func(b[i],begin,int_code);
begin=destinatio;
return;
}

int code_debugging_class::char_int(char code) // for code
{
int output;
switch(code)
{
case 'A':
output=0;
break;
case 'B':
output=1;
break;
case 'C':
output=2;
break;
case 'D':
output=3;
break;
case 'E':
output=4;
break;
case 'F':
output=5;
break;
case 'G':
output=6;
break;
case 'H':
output=7;
break;
case 'I':
output=8;
}
return output;
}
direcrtions
#include "motordriver.h"
#include "directions.h"
#include "obstacle_avoiding.h"
#include "mbed.h"
AnalogIn ultrasonic_sensor(p19);
DigitalIn slot(p18);
void directions_class::right(void) //to move right
{
Serial pc(USBTX, USBRX);
pc.printf("\n\r\tmoving right");


count_90=19;


Motor A(p24, p5, p6, 1); // pwm, fwd, rev, can brake
Motor B(p22, p30, p29, 1); // pwm, fwd, rev, can brake

count=0;


A.speed(-1);
B.speed(1);

while(count<=count_90)
{
while(slot.read())
{ }
count++;
pc.printf("\n\r\t%d",count);
while(!(slot.read()))
{}
}

A.stop(1);
B.stop(1);

return;

}

void directions_class::left(void) //to move left
{
Serial pc(USBTX, USBRX);
pc.printf("\n\r\tmoving left");


count_90=22;


Motor A(p24, p5, p6, 1); // pwm, fwd, rev, can brake
Motor B(p22, p30, p29, 1); // pwm, fwd, rev, can brake
count=0;


A.speed(1);
B.speed(-1);

while(count<=count_90)
{
while(slot.read())
{ }
count++;
pc.printf("\n\r\t%d",count);
while(!(slot.read()))
{}
}

A.stop(1);
B.stop(1);

return;

}

void directions_class::back(void) //to move back
{

Serial pc(USBTX, USBRX);
pc.printf("\n\r\tmoving back");


count_180=41;


Motor A(p24, p5, p6, 1); // pwm, fwd, rev, can brake
Motor B(p22, p30, p29, 1); // pwm, fwd, rev, can brake
count=0;

A.speed(-1);
B.speed(1);

while(count<=count_180)
{
while(slot.read())
{ }
count++;
pc.printf("\n\r\t%d",count);
while(!(slot.read()))
{}
}

A.stop(1);
B.stop(1);

return;

}


void directions_class::straight(int n) //to move straight
{



ultrasonic_sensor_detection_threshold=0.7; //for detection of a obstacle
ultrasonic_sensor_error_threshold=0.7; //for waiting when obstacle d
etected after avoidable distance
obstacle_lenght_count=35; //no of counts on slot requir
ed by vehicle to avoid the obsctacle
count_90=20;

Serial pc(USBTX, USBRX);
pc.printf("\n\r\tmoving straight");

Motor A(p24, p5, p6, 1); // pwm, fwd, rev, can brake
Motor B(p22, p30, p29, 1); // pwm, fwd, rev, can brake

count_straight=n;

count=0;


A.speed(1);
B.speed(1);

while(count<=count_straight)
{
while(slot.read())
{ }
count++;
pc.printf("\n\r\t%d\t\t\t%f",count,ultrasonic_sensor.read());
if(ultrasonic_sensor.read()>=ultrasonic_sensor_detection_threshold)
//obstacle detection
{
A.stop(1);
B.stop(1);
if(count>=(n-obstacle_lenght_count))
// if obstacle above avoidable position
{
pc.printf("obstacle detected beyond avoidable range..... please
remove the obstacle to continue");
while(ultrasonic_sensor.read()>=ultrasonic_sensor_detection_thre
shold)
{}
}
else
// if not then obstacle avoiding function is called
{
pc.printf("\n\r\tobstacle detected");
wait(0.5);
obstacle_avoiding_class object;
object.obstacle_avoiding_func();
count=count+65;
}
A.speed(1);
B.speed(1);
}

while(!(slot.read()))
{}
}

A.stop(1);
B.stop(1);

return ;

}


obstacle avoiding
#include "motordriver.h"
#include "obstacle_avoiding.h"
#include "mbed.h"
#include "directions.h"
void obstacle_avoiding_class::obstacle_avoiding_func(void)
{
obstacle_lenght_count=35;
obstacle_width_count=30;

Serial pc(USBTX, USBRX);
directions_class directions_object;
directions_object.right(); //right
directions_object.straight(obstacle_width_count); //right straight
directions_object.left(); //left
directions_object.straight(obstacle_lenght_count); //straight
directions_object.left(); //left
directions_object.straight(obstacle_width_count); //left straight
directions_object.right(); //right and halt
}
excel writing
#include "mbed.h"
Serial pc(USBTX, USBRX); // FOR SERIAL COMMUNICATION VIA
PC
LocalFileSystem local("local"); // Create the local filesystem
under the name "local"
FILE *fr1,*fr2;
int main()
{
fr2= fopen("/local/test_1.xls", "w"); //for scanning direction


fprintf(fr2,"0\t");
fprintf(fr2,"RnL\t");
fprintf(fr2,"n\t");
fprintf(fr2,"nRnL\t");
fprintf(fr2,"nRnnL\t");
fprintf(fr2,"RnnL\t");
fprintf(fr2,"nn\t");
fprintf(fr2,"nnRnL\t");
fprintf(fr2,"nRnnLn\n");//fst row

fprintf(fr2,"LnR\t");// sec row
fprintf(fr2,"0\t");
fprintf(fr2,"LnRn\t");
fprintf(fr2,"n\t");
fprintf(fr2,"nRnL\t");
fprintf(fr2,"RnL\t");
fprintf(fr2,"nnLnR\t");
fprintf(fr2,"nn\t");
fprintf(fr2,"nnRnL\n");

fprintf(fr2,"ZnZ\t");// THRID ROW
fprintf(fr2,"ZnZRnL\t");
fprintf(fr2,"0\t");
fprintf(fr2,"RnL\t");
fprintf(fr2,"RnnL\t");
fprintf(fr2,"RnnRnZ\t");
fprintf(fr2,"n\t");
fprintf(fr2,"nLnR\t");
fprintf(fr2,"RnnLn\n");

fprintf(fr2,"ZnRnR\t");//C ROW
fprintf(fr2,"ZnZ\t");
fprintf(fr2,"LnR\t");
fprintf(fr2,"0\t");
fprintf(fr2,"RnL\t");
fprintf(fr2,"RnRnZ\t");
fprintf(fr2,"nLnR\t");
fprintf(fr2,"n\t");
fprintf(fr2,"RnLn\n");

fprintf(fr2,"ZnRnnR\t");//E ROW
fprintf(fr2,"ZnRnR\t");
fprintf(fr2,"LnnR\t");
fprintf(fr2,"LnR\t");
fprintf(fr2,"0\t");
fprintf(fr2,"ZnZ\t");
fprintf(fr2,"nLnnR\t");
fprintf(fr2,"nLnR\t");
fprintf(fr2,"n\n");

fprintf(fr2,"LnnR\t");//F ROW
fprintf(fr2,"LnR\t");
fprintf(fr2,"nLnnR\t");
fprintf(fr2,"nLnR\t");
fprintf(fr2,"n\t");
fprintf(fr2,"0\t");
fprintf(fr2,"nnLnnR\t");
fprintf(fr2,"nnLnR\t");
fprintf(fr2,"nn\n");

fprintf(fr2,"ZnnZ\t");//G ROW
fprintf(fr2,"ZnnZRn\t");
fprintf(fr2,"ZnZ\t");
fprintf(fr2,"ZnLnL\t");
fprintf(fr2,"RnnRnZ\t");
fprintf(fr2,"RnnRnnZ\t");
fprintf(fr2,"0\t");
fprintf(fr2,"RnL\t");
fprintf(fr2,"RnnL\n");

fprintf(fr2,"ZnnRnR\t");//H ROW
fprintf(fr2,"ZnnZ\t");
fprintf(fr2,"LnLnZ\t");
fprintf(fr2,"ZnZ\t");
fprintf(fr2,"RnRnZ\t");
fprintf(fr2,"RnRnnZ\t");
fprintf(fr2,"LnR\t");
fprintf(fr2,"0\t");
fprintf(fr2,"RnL\n");

fprintf(fr2,"ZnnRnnR\t");//I ROW
fprintf(fr2,"ZnnRnR\t");
fprintf(fr2,"LnnLnZ\t");
fprintf(fr2,"LnLnZ\t");
fprintf(fr2,"ZnZ\t");
fprintf(fr2,"ZnnZ\t");
fprintf(fr2,"LnnR\t");
fprintf(fr2,"LnR\t");
fprintf(fr2,"0\n");



fclose(fr2);


}

You might also like