Day 19 HW
Comment: The program took me awhile to figure out how to correctly modify the header file so that the program would work. I never really understood how to get modification 3 and up to work. Also I never got the interrupt to work correctly on my arduino. Initially, I didn't write attach interrupt and spent a few hours wondering why I couldn't get the interrupt to work. The furthest I got was to get the led to change colors when I pressed the button, but never got the cds value to change the led. #include <stdio.h> #define FILENAME "waves2.txt" /* Define structure to represent a tsunami. */ struct tsunami { int mo, da, yr, fatalities; double max_height; char location[20]; }; int main(void) { /* Declare variables. */ int k=0,i=0, npts,max_fata=0; double max=0, sum=0, ave; struct tsunami t[100]; FILE *waves; /* Read and print information from the file. */ waves = fopen(FILENAME,"r"); if (waves == NULL) printf("Error opening data...