volatile char *dirk,*dird,x;
volatile char *outk,*outd;
void Setupk(int a);
void Setupd(int b);
void Setuplcd(void);
void Setuplcd1(void);
void Write_data(char *c);
void Set_data(char d);
void Delay(int c);
void setup() {
// put your setup code here, to run once:
dirk=0x107; dird=0x2a;
outk=0x108; outd=0x2b;
*dirk=0xff; *dird=0xff;
Setuplcd1();
Write_data("Lakshmanan");
}
void Setupk(int a){
*outk=a;
}
void Setupd(int b){
*outd=b;
}
void Setuplcd(){
Setupd(0x02);
Delay(1);
Setupd(0x00);
Delay(1);
}
void Setuplcd1(){
Setupk(0x38);
Setuplcd();
Setupk(0x0f);
Setuplcd();
Setupk(0x01);
Setuplcd();
}
void Delay(int a){
volatile long j;
while(a){
for(j=0;j<1000;j++);
a--;
}
}
void Write_data(char *c){
while(*c!=0){
Set_data(*c);
c++;
}
}
void Set_data(char d){
Setupk(d);
Setupd(0x01);
Delay(1);
Setupd(0x03);
Delay(1);
Setupd(0x01);
Delay(1);
}
void loop() {
// put your main code here, to run repeatedly:
}