Part a) The value n is one byte, therefore, it can be viewed as two hex digits. Write a C code that extracts the two hex digits from n into the variables below. Then, print the digits on the rightmost two segments of the LCD display and ensure the remaining digits are off. Print leading zeros. Use the variables LCDptr and LCDHexChar from the previous question.

unsigned char n=…;
unsigned char left_digit, right_digit;

Part b) The value x is one byte and contains a decimal number that's between 0 and 99 . Write a C code that extracts the two digits from the value into the variables below. Then print these digits on the LCD display and ensure the remaining digits are off. Don't print leading zeros.

unsigned char x =...;
unsigned char left_digit, right_digit;

Q&A Education