Advertisement
Guest User

Untitled

a guest
Jan 30th, 2023
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.71 KB | None | 0 0
  1. #define DCSBIOS_DEFAULT_SERIAL
  2.  
  3. #include "DcsBios.h"
  4. #include <LCDWIKI_GUI.h> //Core graphics library
  5. #include <LCDWIKI_KBV.h> //Hardware-specific library
  6.  
  7. LCDWIKI_KBV mylcd(ILI9481,A3,A2,A1,A0,A4);
  8.  
  9. #define BLACK 0x0000
  10. #define BLUE 0x001F
  11. #define RED 0xF800
  12. #define GREEN 0x07E0
  13. #define CYAN 0x07FF
  14. #define MAGENTA 0xF81F
  15. #define YELLOW 0xFFE0
  16. #define WHITE 0xFFFF
  17.  
  18. void onUhfPresetChange(char* newValue) {
  19. mylcd.Set_Text_colour(RED);
  20. mylcd.Set_Text_Back_colour(BLACK);
  21. mylcd.Set_Text_Size(6);
  22. mylcd.Print_String(newValue, 294, 110);
  23. }
  24. DcsBios::StringBuffer<2> uhfPresetBuffer(0x1188, onUhfPresetChange);
  25.  
  26. void setup()
  27. {
  28.  
  29. DcsBios::setup();
  30.  
  31. Serial.begin(9600);
  32. mylcd.Init_LCD();
  33. Serial.println(mylcd.Read_ID(), HEX);
  34. mylcd.Fill_Screen(BLACK);
  35.  
  36. mylcd.Set_Text_Mode(0);
  37.  
  38. mylcd.Set_Text_colour(GREEN);
  39. mylcd.Set_Text_Back_colour(BLACK);
  40. mylcd.Set_Text_Size(3);
  41. mylcd.Set_Rotation(1);
  42. mylcd.Print_String("ARC", 400, 20);
  43. mylcd.Print_String("210", 400, 45);
  44.  
  45. mylcd.Set_Text_colour(WHITE);
  46. mylcd.Set_Text_Back_colour(BLACK);
  47. mylcd.Set_Text_Size(1);
  48. mylcd.Set_Rotation(3);
  49. mylcd.Print_String("DIGITAL", 405, 80);
  50. mylcd.Print_String("COMBAT", 407, 90);
  51. mylcd.Print_String("SIMULATOR", 398, 100);
  52.  
  53. mylcd.Set_Text_Size(7.5);
  54. mylcd.Set_Text_Back_colour(WHITE);
  55. mylcd.Print_String("251.025", 105, 250);
  56.  
  57. mylcd.Set_Text_Size(3);
  58. mylcd.Set_Text_colour(RED);
  59. mylcd.Set_Text_Back_colour(BLACK);
  60. mylcd.Print_String("VHF-A", 30, 40);
  61. mylcd.Print_String("VHF-F", 30, 160);
  62. mylcd.Print_String("UHF", 30, 270);
  63.  
  64. mylcd.Set_Draw_color(RED);
  65. mylcd.Draw_Rectangle(20, 258, 86, 298);
  66. //mylcd.Draw_Rectangle(20, 115, 460, 155);
  67. //mylcd.Draw_Rectangle(20, 165, 460, 205);
  68. //mylcd.Set_Draw_color(RED);
  69. //mylcd.Fill_Rectangle(435, 70, 455, 100);
  70. //mylcd.Draw_Rectangle(435, 120, 455, 150);
  71. //mylcd.Draw_Rectangle(437, 122, 453, 148);
  72. //mylcd.Draw_Rectangle(435, 170, 455, 200);
  73. // mylcd.Draw_Rectangle(437, 172, 453, 198);
  74.  
  75. mylcd.Set_Draw_color(WHITE);
  76. mylcd.Draw_Rectangle(265, 80, 350, 160);
  77.  
  78. mylcd.Set_Text_colour(GREEN);
  79. mylcd.Set_Text_Back_colour(BLACK);
  80. mylcd.Set_Text_Size(2);
  81. mylcd.Print_String("PRESET", 274, 85);
  82.  
  83. //mylcd.Set_Text_colour(RED);
  84. //mylcd.Set_Text_Back_colour(BLACK);
  85. //mylcd.Set_Text_Size(6);
  86. //mylcd.Print_String("3", 294, 110);
  87.  
  88. mylcd.Set_Text_colour(GREEN);
  89. mylcd.Set_Text_Back_colour(BLUE);
  90. mylcd.Set_Text_Size(2);
  91. mylcd.Print_String("TACAN: 71X", 265, 180);
  92. mylcd.Print_String("ILS: 11", 265, 200);
  93.  
  94. //mylcd.Draw_Line(10, 170, 370, 230);
  95. //mylcd.Draw_Circle(100, 100, 50);
  96. }
  97.  
  98.  
  99. void loop()
  100. {
  101. DcsBios::loop();
  102. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement