[SOLVED] LED Blinking [CCS C Compiler]

Status
Not open for further replies.

armghan11

Member level 1
Joined
Oct 9, 2012
Messages
41
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,557
Here is the simple program i am using to blink led on pin B0 but i want to blink led on all the 8pins of Port b.... is there any simple way to set all the pins of port b to high... or i have to do it one by one
Code:
#include <16F887.h> 
//#FUSES NOWDT, HS, NOMCLR, NOBROWNOUT, NOIESO, NOLVP 
#use delay(clock=20000000) 


void main() { 


   while (TRUE) { 
     output_high(Pin_B0); 
     delay_ms(100); 

     output_low(PIN_B0); 
     delay_ms(100); 

   } 
}
 
Last edited:

use OUTPUT_B(0xff); to set all pins of port B high and
use OUTPUT_B(0x00); to set all pins of port B low.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…