If you want a single statement ie..
You can also write..
You can also write..
BUT!!! f there are more than one statements it MUST have the curly brackets
So Naturally I use A) the first
Or B) the last....
When you debug the first bit of code... You need to separate the two lines so you can check the operation...
Code:
if ( x== 0 ) PORTB=2;
Code:
if ( x== 0 )
PORTB=2;
Code:
if ( x== 0 )
{
PORTB=2;
}
BUT!!! f there are more than one statements it MUST have the curly brackets
Code:
if ( x== 0 )
{
PORTB = 2;
PORTC = 1;
}
Code:
if ( x== 0 ) PORTB=2;
Or B) the last....
When you debug the first bit of code... You need to separate the two lines so you can check the operation...