Example 7-27 Write an AVR C program to convert ASCII digits of 4' and '7' to packed BCD and dis- play them on PORTB. Solution: include <avr/ io.h> //standard AVR header int main (void) unsigned char bcdbyte; unsigned char w 4 unsigned char z 7 DDRB 0xFF: WW &0x0F //make Port B an output //mask 3 //shift left to make upper BCD digit //mask 3 //combine to make packed BCD bcdbyte wI zi PORTB bedbytei return 0 3. Extend Example 7-27 to read one number each from ASCI 1 !1 and ASCIL 211 arrays and convert them to a packed BCD number and store the number in array PKD_BCDI1 ASCII 111 ('o,1,2,3 ''5',6 7 8:9'1 ASCII-2 [ 1-1'9','8','?,'6','S','4','3','2','1','0'); PKD BCD [101 Show transcribed image text Example 7-27 Write an AVR C program to convert ASCII digits of 4' and '7' to packed BCD and dis- play them on PORTB. Solution: include //standard AVR header int main (void) unsigned char bcdbyte; unsigned char w 4 unsigned char z 7 DDRB 0xFF: WW &0x0F //make Port B an output //mask 3 //shift left to make upper BCD digit //mask 3 //combine to make packed BCD bcdbyte wI zi PORTB bedbytei return 0 3. Extend Example 7-27 to read one number each from ASCI 1 !1 and ASCIL 211 arrays and convert them to a packed BCD number and store the number in array PKD_BCDI1 ASCII 111 ('o,1,2,3 ''5',6 7 8:9'1 ASCII-2 [ 1-1'9','8','?,'6','S','4','3','2','1','0'); PKD BCD [101