anything wrong with this?

Discussion about projects that used PIC Microcontroller, Hardware Interface, Programming Algorithm and etc......

anything wrong with this?

Postby yikwei » Tue Jun 03, 2014 12:08 pm

Screenshot (9).png

CODE: SELECT_ALL_CODE
#include<htc.h>
#define _XTAL_FREQ 20000000

void main()
{
TRISB0=1;
TRISB1=1;
TRISD0=0;
TRISD1=0;

do
{
   if(RB0==0)
   {
   __delay_ms(100);
      if(RB0==0)
      {
      RD0=1;
      __delay_ms(2000);
      RD0=0;
      }
   }
}while(1);

do
{
   if(RB1==0)
   {
   __delay_ms(100);
      if(RB1==0)
      {
      RD1=1;
      __delay_ms(2000);
      RD1=0;
      }
   }
}while(1);

}


any idea what happen?
yikwei
Freshie
 
Posts: 4
Joined: Mon Jun 02, 2014 10:36 am

Re: anything wrong with this?

Postby sich » Mon Jun 09, 2014 11:19 am

Not familiar with Proteus. Anyway, please describe the "wrong" so we can assist you.
~> How to ask QUESTIONS the SMART way in FORUM? <~
User avatar
sich
Moderator
 
Posts: 603
Joined: Tue Apr 21, 2009 2:15 pm


Return to PIC Microcontroller

Who is online

Users browsing this forum: No registered users and 6 guests