Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top