Question: Open your MPLAB and write a C function f1 (its type is unsigned word) that returns how many elements of an array that satisfies the
- Open your MPLAB and write a C function f1 (its type is unsigned word) that returns how many elements of an array that satisfies the following property: the most significant 4 bits are the same as the middle 4 bits in var. Show that your function is working. (hint: use watches and breakpoints in
MPLAB.
The function input parameters are:
list: the input array, each element is unsigned byte (uint8) var: the variable x which is unsigned byte (uint8) length: number of elements in the list , unsigned byte (uint8)
Example: If the input array is {0x80, 0xE0, 0xEC, 0x7B, 0xFF}, and var=0x38 then the function returns the value 2.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
