Assignment 2: LCD | EMBEDDED AND ROBOTICS

Assignment 2: LCD






QUESTIONS:-


1) Print a character on lcd
2) Print your name
3) Print a to z
4) Blink a character on lcd
5) Print a b c d…z  on only 1 coordinate after delay of 100ms
6) Moving name
7) Print name on pressing switch
8)  Make clock
9) Make calendar: having condition of leap year and leap year of century, each month having appropriate days.





SOLUTION TO ASSIGNMENT


I WILL BE USING PORT C BY DEFAULT FOR INTERFACING LCD


1. Print a character on lcd

 while (1)
      {
      lcd_gotoxy(0,0);          // 1st coordinate of lcd
      lcd_putchar('A');         

      }


2.  Print your name

while (1)
      {
      lcd_gotoxy(0,0);          // 1st coordinate of lcd
      lcd_putsf("katrina");         

      }





3.    Print a to z


 a=65;
   b=0;
   c=0;
while (1)
      { 
                               // intialise b as integer variable at top of   
                                   program

      lcd_gotoxy(b,c);         
      lcd_putchar(a); 
      delay_ms(100);             // header file delay.h
      a++;b++;
        if(a==91){a=65;}
        if(b==16){c++;b=0;}
        if(c==2){c=0;}
     
     }
}


//a is taken as 65 as ascii value of 'a' is 65
//b specifies coloumn number
//c specifies row in lcd


4.  
while (1)
      { 
      lcd_gotoxy(0,0);               
      lcd_putchar('a'); 
      delay_ms(100); 
      lcd_clear();
      delay_ms(100);          

  }






5.     Print a b c d…z  on only 1 coordinate after delay of 100ms


b=65;              // intialise b as integer variable at  top of program

while (1)
      { 
        lcd_gotoxy(0,0);          // 1st coordinate of lcd         
      lcd_putchar(b); 
      b++;
      delay_ms(100);             // header file delay.h
     }
}


//b is taken as 65 as ascii value of a is 65



6.   Moving name

      a=0;b=0;
while (1)
      { 
      lcd_gotoxy(b,a);              
      lcd_putsf("anshul");
       b++;
      if(b==10){b=0;}        
      delay_ms(100);  
      lcd_clear();
       
     }
}






7.

DDRB.0=0;
while (1)
      { 
      if(PINB.0==1)
      {
      lcd_gotoxy(0,0);              
      lcd_putsf("anshul");
       }
       
     }
}


CLOCK AND CALENDER : DO YOURSELF…IF YOU WANT  PROGRAM, COMMENT YOUR EMAIL BELOW AND I WILL SEND IT




10 comments:

  1. abhishekarmaan91@gmail.com ..

    can u plz send me the program to make stop watch n calender with atmega 16..

    thnk u

    ReplyDelete
  2. kumarankur860@ gmail.com ..
    can u plz send me the program to make stop watch n calender with atmega 16..
    thnk u

    ReplyDelete
  3. samshankya@gmail.com
    pls send the program for clock and calendar

    ReplyDelete
  4. tapaskumar61@gmail.com
    plz send me the program for clock & calendar.....
    thank you....

    ReplyDelete
  5. Plz send me the program for clock and calender

    ReplyDelete
  6. r4saumya@gmail.com I want program for calendar

    ReplyDelete
  7. sumitchamp1995@gmaio.com
    I want the clock and calendar program

    ReplyDelete
  8. pavanirajitha777@gmail.com
    plzz send me clock and calendar

    ReplyDelete

Related Posts Plugin for WordPress, Blogger...

Popular Posts