//------------main---------------------------- int main(void){ PLL_Init(); SysTick_Init(); Switch_Init(); Output_Init(); // print intro screen to lab printf(" Fixed-point Lab\n"); printf("\n\n\n\n\n\n\n\n\n\n"); printf(" By:\n"); printf(" Brandon Boesch\n"); printf(" Curtis Martin\n"); printf(" Press SW2 to begin\n"); ST7735_DrawBitmap(30, 108, bmp_Logo, 70, 100); // begin tests while(PF0 == 0x01){}; Fixed_uDecOut2_test(); while(PF0 == 0x01){}; Fixed_sDecOut3_test(); while(PF0 == 0x01){}; Fixed_uBinOut8_test(); while(PF0 == 0x01){}; // outro screen Output_Clear(); ST7735_SetCursor(0,0); printf("Tests complete!"); ST7735_DrawBitmap(6, 159, bmp_thumbs, 114, 146); while(1){}; }
int main(void) { int i; Output_Init(); Output_Color(15); printf("Hello, world."); printf("%c", NEWLINE); Delay(4000000); // delay ~1 sec at 12 MHz Output_Color(8); printf("A really long string should go to the next line.\r"); printf("Oxxx(:::::::::::::::>%c", NEWLINE); Delay(4000000); // delay ~1 sec at 12 MHz Output_Color(15); printf("Color Table:%c", NEWLINE); Delay(4000000); // delay ~1 sec at 12 MHz Output_Color(8); printf("<:::::::::::::::)xxxO%c", NEWLINE); for(i=15; i>=1; i=i-2) { Delay(4000000); // delay ~1 sec at 12 MHz Output_Color(i); printf("Color: %u%c", i, TAB); Output_Color(i-1); printf("Color: %u%c", i-1, NEWLINE); } Delay(4000000); // delay ~1 sec at 12 MHz Output_Clear(); while(1) {}; }
//------------Fixed_uBinOut8_test------------ // Test case for Fixed_sDecOut3 function. Unigned 32-bit binary fixed-point with a resolution of 1/256. void Fixed_uBinOut8_test(void){ Output_Clear(); ST7735_SetCursor(0,0); printf("Fixed_uBinOut8_test\n"); for(int i = 0; i < ARRAY_SIZE; i++){ Fixed_uBinOut8(BinCases[i]); SysTick_Wait10ms(10); } printf("Press SW2 to cont."); }