Jan 13, 2013 #1 A 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: Jan 13, 2013
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); } }
Jan 13, 2013 #2 I iukhan Advanced Member level 4 Joined Oct 4, 2007 Messages 107 Helped 31 Reputation 62 Reaction score 29 Trophy points 1,308 Location Lahore Activity points 2,013 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.
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.
Jan 13, 2013 #3 A 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 iukhan said: 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. Click to expand... thank u brother it worked
iukhan said: 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. Click to expand... thank u brother it worked