Nathan Monk
/
CITY3032_Template
Template for working forward
Revision 5:c3192cde622f, committed 2021-10-20
- Comitter:
- 10724928
- Date:
- Wed Oct 20 11:31:36 2021 +0000
- Parent:
- 4:d129442ea4dd
- Commit message:
- Template;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r d129442ea4dd -r c3192cde622f main.cpp --- a/main.cpp Sun Oct 17 18:29:13 2021 +0000 +++ b/main.cpp Wed Oct 20 11:31:36 2021 +0000 @@ -4,7 +4,7 @@ #include "GUI.h" #include "cy8ckit_028_tft.h" -#define LED_DIAMETER (16) +#define LED_DIAMETER (25) #define LED_RADIUS (LED_DIAMETER/2) #define DISPLAY_X (320) #define DISPLAY_Y (240) @@ -21,13 +21,13 @@ /* Set font size, foreground and background Colours */ GUI_SetFont(GUI_FONT_16B_1); - GUI_SetColor(GUI_WHITE); - GUI_SetBkColor(GUI_BLACK); + GUI_SetColor(GUI_DARKCYAN); + GUI_SetBkColor(GUI_DARKRED); /* Clear screen and print splash screen */ GUI_Clear(); GUI_SetTextAlign(GUI_TA_HCENTER); - GUI_DispStringAt("asr666 Super Computer", 160, 0); + GUI_DispStringAt("MONKTON", 100, 0); } int main() @@ -38,12 +38,12 @@ printf("Starting Supercomputer\r\n"); GUI_SetFont(GUI_FONT_8X16X2X2); - GUI_SetColor(GUI_DARKGREEN); + GUI_SetColor(GUI_DARKYELLOW); uint8_t array[NUMLEDS_X][NUMLEDS_Y]; for (int j=0; j < NUMLEDS_Y; j++) { for (int i=0; i < NUMLEDS_X; i++) { array[i][j]=LED_OFF; - GUI_SetColor(GUI_DARKGREEN); + GUI_SetColor(GUI_DARKYELLOW); GUI_FillCircle(LED_RADIUS+(i)*LED_DIAMETER, TITLE_OFFSET+(j*LED_DIAMETER), LED_RADIUS); } } @@ -51,12 +51,12 @@ int ledx = rand()%NUMLEDS_X; int ledy = rand()%NUMLEDS_Y; if (array[ledx][ledy]==LED_OFF) { - GUI_SetColor(GUI_GREEN); + GUI_SetColor(GUI_YELLOW); GUI_FillCircle(LED_RADIUS+(ledx)*LED_DIAMETER, TITLE_OFFSET+LED_DIAMETER*(ledy), LED_RADIUS); array[ledx][ledy] = LED_ON; } else { - GUI_SetColor(GUI_DARKGREEN); + GUI_SetColor(GUI_DARKYELLOW); GUI_FillCircle(LED_RADIUS+(ledx)*LED_DIAMETER, TITLE_OFFSET+LED_DIAMETER*(ledy), LED_RADIUS); // GUI_FillCircle(8+(ledx)*16, 24+16*(ledy), 8); array[ledx][ledy] = LED_OFF;