/**************************************************************************************** * Subroutine to check r10 and display accordingly * x = x coordinate, y = y coordinate, val = r10's value ****************************************************************************************/ void VGA_Polling(int x,int y, int val){ /* output text message to the LCD */ LCD_cursor (0,0); // set LCD cursor location to top row LCD_text ("Selected Effect :-\0"); VGA_box(0, 60, 319, 179, 0); if (val == 1){ hollow_rect(20,90,100,20,0x7777); hollow_rect(20,120,100,20,0x2222); hollow_rect(20,150,100,20,0x2222); hollow_rect(20,180,100,20,0x2222); hollow_rect(20,210,100,20,0x2222); LCD_cursor (0,1); // set LCD cursor location to bottom row LCD_text ("Distortion \0"); LCD_cursor_off (); VGA_text (10, 20, "Active effect is Distortion \0"); } else if (val == 2){ hollow_rect(20,90,100,20,0x2222); hollow_rect(20,120,100,20,0x7777); hollow_rect(20,150,100,20,0x2222); hollow_rect(20,180,100,20,0x2222); hollow_rect(20,210,100,20,0x2222); VGA_text (10, 20, "Active effect is Echo \0"); LCD_cursor (0,1); // set LCD cursor location to bottom row LCD_text ("Echo \0"); LCD_cursor_off (); } else if (val == 3){ hollow_rect(20,90,100,20,0x2222); hollow_rect(20,120,100,20,0x2222); hollow_rect(20,150,100,20,0x7777); hollow_rect(20,180,100,20,0x2222); hollow_rect(20,210,100,20,0x2222); VGA_text (10, 20, "Active effect is Kill Switch\0"); LCD_cursor (0,1); // set LCD cursor location to bottom row LCD_text ("Kill Switch \0"); LCD_cursor_off (); }else if (val == 4){ hollow_rect(20,90,100,20,0x2222); hollow_rect(20,120,100,20,0x2222); hollow_rect(20,150,100,20,0x2222); hollow_rect(20,180,100,20,0x7777); hollow_rect(20,210,100,20,0x2222); VGA_text (10, 20, "Active effect is Bit Crusher\0"); LCD_cursor (0,1); // set LCD cursor location to bottom row LCD_text ("Bit Crusher \0"); LCD_cursor_off (); } else if (val == 5){ hollow_rect(20,90,100,20,0x2222); hollow_rect(20,120,100,20,0x2222); hollow_rect(20,150,100,20,0x2222); hollow_rect(20,180,100,20,0x2222); hollow_rect(20,210,100,20,0x7777); VGA_text (10, 20, "Plain output activated \0"); LCD_cursor (0,1); // set LCD cursor location to bottom row LCD_text ("Plain Audio \0"); LCD_cursor_off (); } }
void task1(void* pdata) { char strTemp[2]; while (1) { PS2(); VGA_box(0, 0, 319, 239, 0); strTemp[0] = getKey(); printf("getKey: %c\n", strTemp[0]); VGA_text(5, 5, strTemp); VGA_box(0, 0, 319, 239, 0); } }
/**************************************************************************************** * Subroutine to write "Welcome" on the LCD cursor * x = x coordinate, int y = y coordinate ****************************************************************************************/ void VGA_welcome(int x,int y) { char text[40] = "Welcome\0"; VGA_text (x, y, text); }
/**************************************************************************************** * Subroutine to write The instructions on the LCD cursor * x = x coordinate, int y = y coordinate ****************************************************************************************/ void VGA_Description(int x,int y) { char text[50] = "Make sure that the input and output is connected to DE2\0"; VGA_text (x, y++, text); y=y+1; VGA_text (x, y++,"Steps to get this thing working\0"); VGA_text (x, y++, "1)Use `s` for next\0"); VGA_text (x, y++, "2)Use `a` for previous\0"); VGA_text (x, y++, "3)Activate/Deactivate sound using KEY[3]\0"); VGA_text (x, 25, "Distortion \0"); VGA_text (x, 32, " Echo \0"); VGA_text (x, 40, "Kill Switch\0"); VGA_text (x, 47, "Bit Crusher\0"); VGA_text (x, 55, " Regular \0"); VGA_text (35, 24, "Works with High input volume and low \0"); VGA_text (35, 25, "output volume\0"); VGA_text (35, 31, "Press KEY[1] to start and stop recording\0"); VGA_text (35, 33, "Press KEY[2] to terminate loop and resume\0"); VGA_text (35, 34, "normal playback\0"); VGA_text (35, 39, "Keep KEY[2] pressed to kill audio\0"); VGA_text (35, 46, "No instructions here :)\0"); VGA_text (35, 54, "Plain audio without any processing \0"); LCD_cursor (0,0); // set LCD cursor location to top row LCD_text ("whats up \0"); LCD_cursor (0,1); // set LCD cursor location to top row LCD_text ("Lets Get Started\0"); LCD_cursor_off (); // turn off the LCD cursor }
void display_enable(int check){ if(check) VGA_text (50, 20, "Sound is active \0"); else VGA_text (50, 20, "Sound is not active\0"); }