Question: 1 . Write a C program for the Arduino Mega which will:Monitor incoming characters from the Megas UART, for A , B , C ,

1. Write a C program for the Arduino Mega which will:Monitor incoming characters from the Megas UART, for A, B, C, D, E, F, G, and Q, usingthe serial functions you wrote in the UART lab (U0Init(), kbhit(), getchar(), andputchar()).Generate a square wave on Port B.6 of the appropriate frequency depending on the keypressed, as indicated in the table below.Output logical 0 when the program first starts, and after the UART receives a QcharacterFrequency TableNote Frequency HzA 440B 494C 523D 587E 659F 698G 784NOTE: Generating the square wave will not take place in the main loop of the program,but instead in the overflow Interrupt Service Routine of Timer #1.Hint: Start with the code you wrote in the Timer Lab, and make two changes:Implement your own serial I/O routines U0Init(), kbhit(), getchar(), and putchar()instead of the Arduino library serial functions to read the note to be played from theUART.Implement an ISR function for the Overflow Interrupt on Timer #1(TIMER1 OVF)which will:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!