Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define DCSBIOS_DEFAULT_SERIAL
- #include <LCDWIKI_GUI.h> //Core graphics library
- #include <LCDWIKI_KBV.h> //Hardware-specific library
- #include "DcsBios.h"
- LCDWIKI_KBV mylcd(ILI9341,A3,A2,A1,A0,A4);
- #define BLACK 0x0000
- #define GREEN 0x07E0
- // *** UHF-Frequency ***
- void onUhfFrequencyChange(char* newValue) {
- mylcd.Set_Text_colour(GREEN);
- mylcd.Set_Text_Back_colour(BLACK);
- mylcd.Set_Text_Size(5);
- mylcd.Print_String(newValue, 113, 190);
- }
- DcsBios::StringBuffer<7> uhfFrequencyBuffer(0x1180, onUhfFrequencyChange);
- // *** Preset ***
- void onUhfPresetChange(char* newValue) {
- mylcd.Set_Text_colour(GREEN);
- mylcd.Set_Text_Back_colour(BLACK);
- mylcd.Set_Text_Size(4);
- mylcd.Print_String(newValue, 143, 70);
- }
- DcsBios::StringBuffer<2> uhfPresetBuffer(0x1188, onUhfPresetChange);
- // *** TACAN Channel ***
- void onTacanChannelChange(char* newValue) {
- mylcd.Set_Text_colour(GREEN);
- mylcd.Set_Text_Back_colour(BLACK);
- mylcd.Set_Text_Size(1);
- mylcd.Print_String(newValue, 165, 120);
- }
- DcsBios::StringBuffer<4> tacanChannelBuffer(0x1162, onTacanChannelChange);
- // *** ILS Frequency ***
- void onIlsFrequencySChange(char* newValue) {
- mylcd.Set_Text_colour(GREEN);
- mylcd.Set_Text_Back_colour(BLACK);
- mylcd.Set_Text_Size(1);
- mylcd.Print_String(newValue, 150, 140);
- }
- DcsBios::StringBuffer<6> ilsFrequencySBuffer(0x12d8, onIlsFrequencySChange);
- void setup()
- {
- DcsBios::setup();
- mylcd.Init_LCD();
- mylcd.Fill_Screen(BLACK);
- mylcd.Set_Text_Mode(0);
- mylcd.Set_Rotation(1);
- mylcd.Set_Text_Size(2);
- mylcd.Set_Text_colour(GREEN);
- mylcd.Set_Text_Back_colour(BLACK);
- mylcd.Print_String("VHF-A", 20, 30);
- mylcd.Print_String("VHF-F", 20, 120);
- mylcd.Print_String("UHF", 20, 200);
- mylcd.Set_Draw_color(GREEN);
- mylcd.Draw_Rectangle(10, 190, 65, 225);
- mylcd.Set_Draw_color(GREEN);
- mylcd.Draw_Rectangle(110, 35, 215, 110);
- mylcd.Set_Text_colour(GREEN);
- mylcd.Set_Text_Back_colour(BLACK);
- mylcd.Set_Text_Size(2);
- mylcd.Print_String("PRESET", 127, 45);
- mylcd.Set_Text_colour(GREEN);
- mylcd.Set_Text_Back_colour(BLACK);
- mylcd.Set_Text_Size(1);
- mylcd.Print_String("TACAN: ", 125, 120);
- mylcd.Print_String("ILS: ", 125, 140);
- }
- void loop()
- {
- DcsBios::loop();
- }
Advertisement
Add Comment
Please, Sign In to add comment