Why not work in the simulation?

Beta Testing discussion on mikroC PRO for PIC.
Post Reply
Author
Message
vgbudakoglu
Posts: 1
Joined: 25 Jun 2016 14:50

Why not work in the simulation?

#1 Post by vgbudakoglu » 25 Jun 2016 16:08

I'm just starting to have a lot of programming and I do not know.
I made a circuit for LED illumination when the button is pressed.
Proteus could not run in circuit simulations.

Thank you.

I wrote the program in this way.

void main()
{
adcon1=0x0f;
trisa.b0=1;
trisb.b0=0;
porta=0;
portb=0;
while(1);
{
if(porta.b0=1);
delay_ms(1000);
portb.b0=1;
}
}
Attachments
devre.jpg
devre.jpg (157.02 KiB) Viewed 2885 times

PeDre
Posts: 27
Joined: 04 Oct 2010 07:16
Location: Austria

Re: Why not work in the simulation?

#2 Post by PeDre » 27 Jun 2016 08:47

Just a small remark, for comparing you need to use '==' not '='.

Peter

Code: Select all

while(1);
{
  if(porta.b0 == 1) {
    portb.b0 = 1;
    delay_ms(1000);
    portb.b0 = 0;
  }
}

Post Reply

Return to “mikroC PRO for PIC Beta Testing”