Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /************************************************
- Si le message a, b, c ou d est reçu par UART,
- une des LEDs reliées à RA0, RA1, RA2 et RA3
- s'allume.
- MPLAB Xpress Evaluation Board
- *************************************************/
- #include "mcc_generated_files/mcc.h"
- void main(void)
- {
- char message;
- SYSTEM_Initialize();
- while (1)
- {
- message = getch();
- if (message == 'a') {
- IO_RA0_SetHigh();
- IO_RA1_SetLow();
- IO_RA2_SetLow();
- IO_RA3_SetLow();
- }
- if (message == 'b') {
- IO_RA0_SetLow();
- IO_RA1_SetHigh();
- IO_RA2_SetLow();
- IO_RA3_SetLow();
- }
- if (message == 'c') {
- IO_RA0_SetLow();
- IO_RA1_SetLow();
- IO_RA2_SetHigh();
- IO_RA3_SetLow();
- }
- if (message == 'd') {
- IO_RA0_SetLow();
- IO_RA1_SetLow();
- IO_RA2_SetLow();
- IO_RA3_SetHigh();
- }
- }
- }
Add Comment
Please, Sign In to add comment