Guest User

Untitled

a guest
Feb 4th, 2023
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.32 KB | None | 0 0
  1. #define DCSBIOS_DEFAULT_SERIAL
  2.  
  3. #include <LCDWIKI_GUI.h> //Core graphics library
  4. #include <LCDWIKI_KBV.h> //Hardware-specific library
  5. #include "DcsBios.h"
  6.  
  7. LCDWIKI_KBV mylcd(ILI9341,A3,A2,A1,A0,A4);
  8.  
  9. #define BLACK 0x0000
  10. #define GREEN 0x07E0
  11.  
  12. // *** UHF-Frequency ***
  13. void onUhfFrequencyChange(char* newValue) {
  14. mylcd.Set_Text_colour(GREEN);
  15. mylcd.Set_Text_Back_colour(BLACK);
  16. mylcd.Set_Text_Size(5);
  17. mylcd.Print_String(newValue, 113, 190);
  18. }
  19. DcsBios::StringBuffer<7> uhfFrequencyBuffer(0x1180, onUhfFrequencyChange);
  20.  
  21. // *** Preset ***
  22. void onUhfPresetChange(char* newValue) {
  23. mylcd.Set_Text_colour(GREEN);
  24. mylcd.Set_Text_Back_colour(BLACK);
  25. mylcd.Set_Text_Size(4);
  26. mylcd.Print_String(newValue, 143, 70);
  27. }
  28. DcsBios::StringBuffer<2> uhfPresetBuffer(0x1188, onUhfPresetChange);
  29.  
  30. // *** TACAN Channel ***
  31. void onTacanChannelChange(char* newValue) {
  32. mylcd.Set_Text_colour(GREEN);
  33. mylcd.Set_Text_Back_colour(BLACK);
  34. mylcd.Set_Text_Size(1);
  35. mylcd.Print_String(newValue, 165, 120);
  36. }
  37. DcsBios::StringBuffer<4> tacanChannelBuffer(0x1162, onTacanChannelChange);
  38.  
  39. // *** ILS Frequency ***
  40. void onIlsFrequencySChange(char* newValue) {
  41. mylcd.Set_Text_colour(GREEN);
  42. mylcd.Set_Text_Back_colour(BLACK);
  43. mylcd.Set_Text_Size(1);
  44. mylcd.Print_String(newValue, 150, 140);
  45. }
  46. DcsBios::StringBuffer<6> ilsFrequencySBuffer(0x12d8, onIlsFrequencySChange);
  47.  
  48. void setup()
  49. {
  50.  
  51. DcsBios::setup();
  52.  
  53. mylcd.Init_LCD();
  54. mylcd.Fill_Screen(BLACK);
  55. mylcd.Set_Text_Mode(0);
  56. mylcd.Set_Rotation(1);
  57.  
  58. mylcd.Set_Text_Size(2);
  59. mylcd.Set_Text_colour(GREEN);
  60. mylcd.Set_Text_Back_colour(BLACK);
  61. mylcd.Print_String("VHF-A", 20, 30);
  62. mylcd.Print_String("VHF-F", 20, 120);
  63. mylcd.Print_String("UHF", 20, 200);
  64. mylcd.Set_Draw_color(GREEN);
  65. mylcd.Draw_Rectangle(10, 190, 65, 225);
  66.  
  67. mylcd.Set_Draw_color(GREEN);
  68. mylcd.Draw_Rectangle(110, 35, 215, 110);
  69.  
  70. mylcd.Set_Text_colour(GREEN);
  71. mylcd.Set_Text_Back_colour(BLACK);
  72. mylcd.Set_Text_Size(2);
  73. mylcd.Print_String("PRESET", 127, 45);
  74.  
  75. mylcd.Set_Text_colour(GREEN);
  76. mylcd.Set_Text_Back_colour(BLACK);
  77. mylcd.Set_Text_Size(1);
  78. mylcd.Print_String("TACAN: ", 125, 120);
  79. mylcd.Print_String("ILS: ", 125, 140);
  80.  
  81. }
  82.  
  83.  
  84. void loop()
  85. {
  86. DcsBios::loop();
  87. }
Advertisement
Add Comment
Please, Sign In to add comment