Jump to content

LAURRENCE2021

Members
  • Posts

    6
  • Joined

  • Last visited

1 Follower

About LAURRENCE2021

  • Birthday 10/05/1965

Personal Information

  • Flight Simulators
    FSX STEAM
    FS 2020
    DCS
  • Location
    LONDON
  • Interests
    LOTS

Recent Profile Visitors

336 profile views
  1. Hi Looney I did look at this option but going to be a nightmare to program with dcs bios, also cost a few quid for all the matrix units needed I will go with mine at the movement and post an update when complete and working cheers
  2. Greetings I am looking at running the whole caution panel on an Arduino mega to make the coding easer from DCS Bios. With the 40mA limit per pin and the total Loading of the Arduino chip at 200mA I was thinking of using a bank of NPN transistors, using this method it's only drawing 400 micro amps according to the electronics simulator, enough to light the lot Thoughts and comments most welcome Electronics Simulator is TinkerCad from Autodesk Its Freeeeeeeeeeeee
  3. Greetings I have one of those 3.5" screens for the CDU and works fantastic with help from this website with the code, ( CDU not built yet but in progress ) I have upgraded to a 5" TFT but struggling Again with the code any help greatly appreciated Existing code used for the 3.5" works perfect ( may be of use to someone ) #include <Adafruit_GFX.h> #include <Adafruit_GrayOLED.h> #include <Adafruit_SPITFT.h> #include <Adafruit_SPITFT_Macros.h> #include <gfxfont.h> #include <Adafruit_GrayOLED.h> #include <Adafruit_SPITFT.h> #include <Adafruit_SPITFT_Macros.h> #include <gfxfont.h> /* Tell DCS-BIOS to use a serial connection and use the default Arduino Serial library. This will work on the vast majority of Arduino-compatible boards, but you can get corrupted data if you have too many or too slow outputs (e.g. when you have multiple character displays), because the receive buffer can fill up if the sketch spends too much time updating them. If you can, use the IRQ Serial connection instead. */ #define DCSBIOS_IRQ_SERIAL #include "DcsBios.h" #include <Adafruit_GFX.h> #include <UTFTGLUE.h> UTFTGLUE myGLCD(0x9488,A2,A1,A3,A4,A0); void printChar(int row, int col, unsigned char c) { int16_t x = 13 + col * 19; int16_t y = row * 32 + 6; myGLCD.drawChar(x, y, c, 0x07E0, 0x0, 3); } /* paste code snippets from the reference documentation here */ void onCduLine0Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(0, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine0Buffer(0x11c0, onCduLine0Change); void onCduLine1Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(1, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine1Buffer(0x11d8, onCduLine1Change); void onCduLine2Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(2, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine2Buffer(0x11f0, onCduLine2Change); void onCduLine3Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(3, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine3Buffer(0x1208, onCduLine3Change); void onCduLine4Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(4, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine4Buffer(0x1220, onCduLine4Change); void onCduLine5Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(5, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine5Buffer(0x1238, onCduLine5Change); void onCduLine6Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(6, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine6Buffer(0x1250, onCduLine6Change); void onCduLine7Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(7, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine7Buffer(0x1268, onCduLine7Change); void onCduLine8Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(8, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine8Buffer(0x1280, onCduLine8Change); void onCduLine9Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(9, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine9Buffer(0x1298, onCduLine9Change); void setup() { DcsBios::setup(); // Setup the LCD myGLCD.InitLCD(); myGLCD.clrScr(); myGLCD.setTextSize(3); myGLCD.setColor(0, 0, 255); myGLCD.drawRect(10, 0, 469, 319); } void loop() { DcsBios::loop(); } -------------------------------------------------- New code for the 5" TFT Draws a rectangle as requested but no text displayed when connected to DCS with DCS Bios connected and running #include <Adafruit_GFX.h> #include <Adafruit_GrayOLED.h> #include <Adafruit_SPITFT.h> #include <Adafruit_SPITFT_Macros.h> #include <gfxfont.h> #include <Adafruit_GrayOLED.h> #include <Adafruit_SPITFT.h> #include <Adafruit_SPITFT_Macros.h> #include <gfxfont.h> #include <UTFT.h> /* Tell DCS-BIOS to use a serial connection and use the default Arduino Serial library. This will work on the vast majority of Arduino-compatible boards, but you can get corrupted data if you have too many or too slow outputs (e.g. when you have multiple character displays), because the receive buffer can fill up if the sketch spends too much time updating them. If you can, use the IRQ Serial connection instead. */ #define DCSBIOS_IRQ_SERIAL #include "DcsBios.h" #include <Adafruit_GFX.h> #include <UTFTGLUE.h> UTFT myGLCD(SSD1963_800480,38,39,40,41); void printChar(int row, int col, unsigned char c) { int16_t x = 13 + col * 19; int16_t y = row * 32 + 6; // myGLCD.drawChar(x, y, c, 0x07E0, 0x0, 3); } /* paste code snippets from the reference documentation here */ void onCduLine0Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(0, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine0Buffer(0x11c0, onCduLine0Change); void onCduLine1Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(1, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine1Buffer(0x11d8, onCduLine1Change); void onCduLine2Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(2, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine2Buffer(0x11f0, onCduLine2Change); void onCduLine3Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(3, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine3Buffer(0x1208, onCduLine3Change); void onCduLine4Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(4, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine4Buffer(0x1220, onCduLine4Change); void onCduLine5Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(5, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine5Buffer(0x1238, onCduLine5Change); void onCduLine6Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(6, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine6Buffer(0x1250, onCduLine6Change); void onCduLine7Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(7, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine7Buffer(0x1268, onCduLine7Change); void onCduLine8Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(8, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine8Buffer(0x1280, onCduLine8Change); void onCduLine9Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(9, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine9Buffer(0x1298, onCduLine9Change); void setup() { DcsBios::setup(); pinMode(8, OUTPUT); //backlight digitalWrite(8, HIGH);//on // Setup the LCD myGLCD.InitLCD(); myGLCD.clrScr(); //myGLCD.setTextSize(3); myGLCD.setColor(0, 255, 0); //This bit works myGLCD.drawRect(10, 0, 790, 477); // } void loop() { DcsBios::loop(); }
  4. Interesting stuff. uploaded the new glcdfont to the gfx library recompiled the sketch and noticed that the flashing square curser on the CDU screen Had changed into some funny flashing symbol reverted back to the original and works perfect Strange working code I am using #include <Adafruit_GFX.h> #include <Adafruit_GrayOLED.h> #include <Adafruit_SPITFT.h> #include <Adafruit_SPITFT_Macros.h> #include <gfxfont.h> #include <Adafruit_GrayOLED.h> #include <Adafruit_SPITFT.h> #include <Adafruit_SPITFT_Macros.h> #include <gfxfont.h> /* Tell DCS-BIOS to use a serial connection and use the default Arduino Serial library. This will work on the vast majority of Arduino-compatible boards, but you can get corrupted data if you have too many or too slow outputs (e.g. when you have multiple character displays), because the receive buffer can fill up if the sketch spends too much time updating them. If you can, use the IRQ Serial connection instead. */ #define DCSBIOS_IRQ_SERIAL #include "DcsBios.h" #include <Adafruit_GFX.h> #include <UTFTGLUE.h> UTFTGLUE myGLCD(0x9488,A2,A1,A3,A4,A0); void printChar(int row, int col, unsigned char c) { int16_t x = 13 + col * 19; int16_t y = row * 32 + 6; myGLCD.drawChar(x, y, c, 0x07E0, 0x0, 3); } /* paste code snippets from the reference documentation here */ void onCduLine0Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(0, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine0Buffer(0x11c0, onCduLine0Change); void onCduLine1Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(1, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine1Buffer(0x11d8, onCduLine1Change); void onCduLine2Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(2, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine2Buffer(0x11f0, onCduLine2Change); void onCduLine3Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(3, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine3Buffer(0x1208, onCduLine3Change); void onCduLine4Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(4, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine4Buffer(0x1220, onCduLine4Change); void onCduLine5Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(5, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine5Buffer(0x1238, onCduLine5Change); void onCduLine6Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(6, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine6Buffer(0x1250, onCduLine6Change); void onCduLine7Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(7, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine7Buffer(0x1268, onCduLine7Change); void onCduLine8Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(8, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine8Buffer(0x1280, onCduLine8Change); void onCduLine9Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(9, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine9Buffer(0x1298, onCduLine9Change); void setup() { DcsBios::setup(); // Setup the LCD myGLCD.InitLCD(); myGLCD.clrScr(); myGLCD.setTextSize(3); myGLCD.setColor(0, 0, 255); myGLCD.drawRect(10, 0, 469, 319); } void loop() { DcsBios::loop(); }
  5. Thank you works perfect. RobinMli's thread very helpful Top Man
  6. Great work and a huge thank you for the code. I Can Design in 3d CNC all types of stuff laser cut and engrave BUT programming is not my cup of tea The code you have provided works very well with the mega ( Thank you ) but I am having trouble with the strange fonts on the display as pictured Have you any idea Where I could implement a different type of font Thanks in Advance
×
×
  • Create New...