Question: Exercise: Toggle the two PORTA LSB bits ( D 2 & D 3 ) if the switch S 1 connected to RB 4 is ON;
Exercise: Toggle the two PORTA LSB bits D & D if the switch S connected to
RB is ON; else, toggle the two MSB bits D & D Use TMR library function
to generate the time delay.
Check the configuration setting is correct in System Module
Generate the code.
Click main.c and modify the code in the main program space to interact
with the input.
Build and download the code to the curiosity board and test the
function.
You will interact with the input by using Getvalue Partial code below
#include mccgeneratedfilesmcch
void myISRvoid;
volatile int currentIndex;
void mainvoid
School of Engineering LJMU
Embedded Lab Exercises
initialize the device
SYSTEMInitialize;
Enable the Global Interrupts
INTERRUPTGlobalInterruptEnable;
Enable the Peripheral Interrupts
INTERRUPTPeripheralInterruptEnable;
TMRSetInterruptHandlermyISR;
while
Add your application code
ifINGetValue
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
