1. Renren

    Thread Starter New Member

    Jun 21, 2011
    2
    0
    i am asked to create a timer from 0 - 2 using pic16f84a and two 7 seg bcd..
    the codes in micro c are as follow

    Code ( (Unknown Language)):
    1.  
    2. void main(){
    3.      char x;
    4.      char y;
    5.      PORTA=0;
    6.      PORTB=0;
    7.      TRISA=0;
    8.      TRISB=0;
    9.      for (;;){
    10.          for (y=0;y<3;y++){
    11.          PORTA=y;
    12.          for (x=0;x<10;x++){
    13.          PORTB=x;
    14.          delay_ms(200);
    15.          if (y==2&&x==4){
    16.          PORTA=0;
    17.          PORTB=0;
    18.          for (x=0;x<10;x++){
    19.          }
    20.          }
    21.          }
    22.          }
    23.          }
    24.          }
    25.  
    26.  
    now, im looking for a simpler code than above...
    any help!!!
    thank you!!
     
    • ca3.PNG
      ca3.PNG
      File size:
      13.7 KB
      Views:
      13
    Last edited by a moderator: Jun 22, 2011
  2. Renren

    Thread Starter New Member

    Jun 21, 2011
    2
    0
    for (;;){
    is for (; ; ){
     
Loading...