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.

Turn LED on with buttons

Status
Not open for further replies.

mmc1234

Newbie level 2
Joined
May 14, 2012
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,292
Hey I got a problem, in MikroC Pro for PIC

Someone who know how to turn on 2 LEDs with 2 buttons, going through a pic(PIC16F870). 1 button to 1 LED and the other button to the other LED.


The buttons is innput on port C and the LED´s is output on port B.

Thanks
 

Are you looking for some sample source code, or you just want to know how to accomplish this?

read the pins connected to the switch. if on or off set the led corresponding pin on or off.

you can also read port C and transfer the data to port B (provided the LED is connected the same way as the switches)
 

Yeah sample source code, would be cool.

---------- Post added at 14:23 ---------- Previous post was at 14:22 ----------

Are you looking for some sample source code, or you just want to know how to accomplish this?

read the pins connected to the switch. if on or off set the led corresponding pin on or off.

you can also read port C and transfer the data to port B (provided the LED is connected the same way as the switches)

Yeah sample source code, would be cool.
 

Hi mmc1234
sample MikroC PIC16F870
2x button portC
2x Leds portB
Shematic Proteus inlcus and source code MikroC v.5.60
 

Attachments

  • 18F870 teste button.rar
    19 KB · Views: 60
  • proteus ISIS.JPG
    proteus ISIS.JPG
    102 KB · Views: 83
Last edited:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top