int main(void){ Output_Init(); // ST7735_XYplotInit("Temp", 0, 100, 0, 100); PLL_Init(Bus80MHz); // 80 MHz SYSCTL_RCGCGPIO_R |= 0x20; // activate port F ADC0_InitSWTriggerSeq3_Ch9(); // allow time to finish activating Timer0A_Init100HzInt(); // set up Timer0A for 100 Hz interrupts GPIO_PORTF_DIR_R |= 0x06; // make PF2, PF1 out (built-in LED) GPIO_PORTF_AFSEL_R &= ~0x06; // disable alt funct on PF2, PF1 GPIO_PORTF_DEN_R |= 0x06; // enable digital I/O on PF2, PF1 // configure PF2 as GPIO GPIO_PORTF_PCTL_R = (GPIO_PORTF_PCTL_R&0xFFFFF00F)+0x00000000; GPIO_PORTF_AMSEL_R = 0; // disable analog functionality on PF PF2 = 0; // turn off LED EnableInterrupts(); ST7735_SetCursor(6,0); printf("C"); ST7735_SetCursor(13,0); printf("ADC"); while(1){ PF1 ^= 0x02; // toggles when running in main temperature = adcToTemp(ADCvalue); ST7735_SetCursor(0,0); ST7735_sDecOut2(temperature); ST7735_SetCursor(9,0); ST7735_OutUDec(ADCvalue); } }
int main(void){ PLL_Init(Bus80MHz); // 80 MHz DisableInterrupts(); //ADC0_InitSWTriggerSeq3_Ch9(); // allow time to finish activating Timer0A_Init100HzInt(); // set up Timer0A for 100 Hz interrupts Timer1_Init(); Display_Init(); //initialize display Timer2_Init1Hz(); PortF_Init(); //initialize portf with onboard switches PortE_Init(); // initialize port e as breadboard switches. EnableInterrupts(); while(1){ } }
int main(void){ PLL_Init(Bus80MHz); // 80 MHz SYSCTL_RCGCGPIO_R |= 0x20; // activate port F ADC0_InitSWTriggerSeq3_Ch9(); // allow time to finish activating Timer0A_Init100HzInt(); // set up Timer0A for 100 Hz interrupts Timer1_Init(); //Timer2_Init(); //Enable this for part D. GPIO_PORTF_DIR_R |= 0x06; // make PF2, PF1 out (built-in LED) GPIO_PORTF_AFSEL_R &= ~0x06; // disable alt funct on PF2, PF1 GPIO_PORTF_DEN_R |= 0x06; // enable digital I/O on PF2, PF1 // configure PF2 as GPIO GPIO_PORTF_PCTL_R = (GPIO_PORTF_PCTL_R&0xFFFFF00F)+0x00000000; GPIO_PORTF_AMSEL_R = 0; // disable analog functionality on PF PF2 = 0; // turn off LED EnableInterrupts(); while(1){ PF1 ^= 0x02; // toggles when running in main //GPIO_PORTF_DATA_R ^= 0x02; // Uncomment this for part C. and comment the line above. //PF1 = (PF1*12345678)/1234567+0x02; // Uncomment this for part D. if(i==1000){ int largest = 0; for(int j; j < 1000; j++){ if(largest < array2[i]){ largest = array2[i]; i++; } } Output_Init(); // initialize output device Errors = 0; int x; int y; DisableInterrupts(); storeFrequency(); makePMF(array3, pmf); ST7735_XYplotInit("Lab 2 PMF", 0, 4095, 0, 1000); for(int j = 0; j < 1000; j += 10){ ST7735_PlotBar(pmf[j] * 9); ST7735_PlotNext(); } break; } } while(1); }