Friday, June 7, 2013

Microrocontroller & Seven Segments- Counter 0 to 9 - Method1

In this tutorial, we will exceed our knowledge of how to interface microcontroller with seven segment through only resistors

See this mapping table to get clear understanding


Code:

void main()
{

      char patterns[]={63,6,91,79,102,109,125,7,127,111} ;
      unsigned char i ;
     
      TRISD = 0 ; PORTD = 0 ;
     
      while(1)
      {  
         for(i = 0 ; i <= 9 ; i++)
         {
              PORTD = patterns[i] ;
              Delay_ms(500) ;
         }


      }

}

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...