Hello,
I'm using a 18F2620 and would like to get 2 interrupts for 2 push buttons . ( BP is pulled-up high with resistance, the level gets down when BP is pressed )
I need one task to be done when BP1 (connected to RC6) is pressed, and do another task when BP2 ( connected to RC7) is pressed.
In fact, i would like to use interruptions to change my LCD screen display :
When BP1 is pressed -> my LCD display will show : ie " Message 1 "
if BP2 is pressed then LCD will display another message ie : " Message 2 "
if no BP are pressed ( normal condition ) , then it shows "Message 3"
Can someone put me on the way to declare and set interruption to have a task run when a BP is pressed ?
It is possible to have 2 differents interrupts : one for BP1 and another one for BP2 ?
A code example would be much appreciated
Many thanks for your help,
Newbie question about push button interrupt code snippet
- tihomir.losic
- mikroElektronika team
- Posts: 2138
- Joined: 02 Dec 2009 14:16
- Location: Serbia
- Contact:
Re: Newbie question about push button interrupt code snippet
Hello,
in attachment is our example for Buttons library.
Please, look at it in order to make your project successfully.
Also, I am suggesting you new version of mikroC PRO for PIC, which you can download from following link:
http://www.mikroe.com/esupport/index.ph ... &newsid=15
For any further assistance, feel free to contact me.
Best regards,
Losic Tihomir
in attachment is our example for Buttons library.
Please, look at it in order to make your project successfully.
Also, I am suggesting you new version of mikroC PRO for PIC, which you can download from following link:
http://www.mikroe.com/esupport/index.ph ... &newsid=15
For any further assistance, feel free to contact me.
Best regards,
Losic Tihomir
- Attachments
-
- Button.rar
- (30.44 KiB) Downloaded 292 times
mikroElektronika [Support team]
Re: Newbie question about push button interrupt code snippet
Thanks, but this example is not working with interrupts , isn't ?
- tihomir.losic
- mikroElektronika team
- Posts: 2138
- Joined: 02 Dec 2009 14:16
- Location: Serbia
- Contact:
Re: Newbie question about push button interrupt code snippet
Hello,
yes you're right, and examples for Interrupt you can find at installation folder of compiler:
For example:
C:\Program Files\Mikroelektronika\mikroC PRO for PIC v4.1\Examples\Internal MCU modules\P18F8520
Best regards,
Losic Tihomir
yes you're right, and examples for Interrupt you can find at installation folder of compiler:
For example:
C:\Program Files\Mikroelektronika\mikroC PRO for PIC v4.1\Examples\Internal MCU modules\P18F8520
Best regards,
Losic Tihomir
mikroElektronika [Support team]