Last active
December 8, 2018 12:21
Lorsqu'on appuie sur le bouton du MPLAB Xpress Evaluation Board, la LED D2 s'allume et la LEd D5 s'éteint.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************************************** | |
Lorsqu'on appuie sur le bouton du MPLAB Xpress | |
Evaluation Board, la LED D2 s'allume et la LEd D5 | |
s'éteint. | |
http://electroniqueamateur.blogspot.com/2017/10/mplab-xpress-evaluation-board.html | |
****************************************************/ | |
#include "mcc_generated_files/mcc.h" | |
void main(void) | |
{ | |
SYSTEM_Initialize(); | |
while (1) | |
{ | |
if (IO_RA5_GetValue()) //bouton pas enfoncé | |
{ | |
IO_RA0_SetLow(); // On éteint la LED 1 | |
IO_RA3_SetHigh(); // On allume la LED 4 | |
} | |
else //bouton enfoncé | |
{ | |
IO_RA0_SetHigh(); // on allume la LED 1 | |
IO_RA3_SetLow(); // on éteint la LED 4 | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment