

sarge
Members-
Posts
11 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by sarge
-
DCS-BIOS F/A-18C library. Get it here!
sarge replied to Bullant's topic in Controller Questions and Bugs
Can one of you guru's help me out with the UFC display output? All of the option display work great across multiple 1602LCD's with an I2C backpack but the "UFC Scratch pad" I'm at a loss. It will register and show on the LCD as I make a change, but It will not show something constant. For example if I rotate the comm knob it doesn't show the freq, but if I punch it in it shows, then goes blank. Any ideas? define DCSBIOS_IRQ_SERIAL #include <DcsBios.h> #include <Wire.h> #include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd1(0x3E,16,2); LiquidCrystal_I2C lcd2(0x3F,16,2); LiquidCrystal_I2C lcd3(0x3D,16,2); LiquidCrystal_I2C lcd4(0x3B,16,2); void setup() { DcsBios::setup(); //WE define our LCD 16 columns and 2 rows lcd1.init(); lcd1.init(); lcd1.backlight(); //lcd.backlight(); Power off the back light lcd2.init(); lcd2.init(); lcd2.backlight(); lcd3.init(); lcd3.init(); lcd3.backlight(); lcd4.init(); lcd4.init(); lcd4.backlight(); } void loop(){ DcsBios::loop(); } void onUfcOptionDisplay1Change(char* newValue) { lcd1.clear(); lcd1.setCursor (0,0); lcd1.print(newValue); } DcsBios::StringBuffer<4> ufcOptionDisplay1Buffer(0x542a, onUfcOptionDisplay1Change); void onUfcOptionDisplay2Change(char* newValue) { lcd1.setCursor (0,1); lcd1.print(newValue); } DcsBios::StringBuffer<4> ufcOptionDisplay2Buffer(0x542e, onUfcOptionDisplay2Change); void onUfcOptionDisplay3Change(char* newValue) { lcd2.clear(); lcd2.setCursor (0,0); lcd2.print(newValue); } DcsBios::StringBuffer<4> ufcOptionDisplay3Buffer(0x5432, onUfcOptionDisplay3Change); void onUfcOptionDisplay4Change(char* newValue) { lcd2.setCursor (0,1); lcd2.print(newValue); } DcsBios::StringBuffer<4> ufcOptionDisplay4Buffer(0x5436, onUfcOptionDisplay4Change); void onUfcOptionDisplay5Change(char* newValue) { lcd3.clear(); lcd3.setCursor (0,0); lcd3.print(newValue); } DcsBios::StringBuffer<4> ufcOptionDisplay5Buffer(0x543a, onUfcOptionDisplay5Change); void onUfcScratchpadString1DisplayChange(char* newValue) { lcd4.clear(); lcd4.setCursor (0,0); lcd4.print(newValue); } DcsBios::StringBuffer<2> ufcScratchpadString1DisplayBuffer(0x5446, onUfcScratchpadString1DisplayChange); void onUfcScratchpadString2DisplayChange(char* newValue) { lcd4.clear(); lcd4.setCursor (3,0); lcd4.print(newValue); } DcsBios::StringBuffer<2> ufcScratchpadString2DisplayBuffer(0x5448, onUfcScratchpadString2DisplayChange); void onUfcScratchpadNumberDisplayChange(char* newValue) { lcd4.clear(); lcd4.setCursor (5,0); lcd4.print(newValue); } DcsBios::StringBuffer<8> ufcScratchpadNumberDisplayBuffer(0x543e, onUfcScratchpadNumberDisplayChange); -
Update! After shamelessly reverse engineering other code on the internet, this sketch is working and displaying comm channel 1 #define DCSBIOS_DEFAULT_SERIAL #include <DcsBios.h> #include <SPI.h> #include <Wire.h> #include <Adafruit_GFX.h> #include <Adafruit_SSD1306.h> #define SCREEN_WIDTH 128 // OLED display width, in pixels #define SCREEN_HEIGHT 64 // OLED display height, in pixels // Declaration for an SSD1306 display connected to I2C (SDA, SCL pins) #define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin) Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET); void setup() { display.begin(SSD1306_SWITCHCAPVCC, 0x3C); display.clearDisplay(); DcsBios::setup(); } // put your setup code here, to run once: void loop() { DcsBios::loop(); // put your main code here, to run repeatedly: DcsBios::Switch2Pos ufc0("UFC_0", 8); } void onUfcComm1DisplayChange(char* newValue) { /* your code here */ display.clearDisplay(); display.setTextSize(5); display.setTextColor(WHITE); display.setCursor(35,0); display.print(newValue); display.display(); } DcsBios::StringBuffer<2> ufcComm1DisplayBuffer(0x541c, onUfcComm1DisplayChange); Single alphanumeric looks fine, but 2 digits ends up odd. Any ideas? Thats an "m" and the other shoud be "12"
-
Sorry for the noob question, but I think searching the forums is what got me into trouble lol. So I'm planning on building a "fancy" button box/UFC for the hornet. Prior experience is only very simple button boxes with Bodnar boards, picked up a leonardo and read up on switch registers and scared myself back into the bodnar board. This time around its DCS-Bios and Arduino, I've got switches working but picked up a small I2C OLED for proof of concept before I dive deep. Initially used an Adafruit sketch to make sure it worked and it was wired correctly, that worked great. Then tried some DCS Bios code and here I am. Initially tried this the I found for the A10 CMSP /*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_DEFAULT_SERIAL #include "DcsBios.h" #include "Wire.h" #include "OLedI2C.h" OLedI2C LCD; /* paste code snippets from the reference documentation here */ void onCmsp1Change(char* newValue) { LCD.sendString(newValue, 0, 0); } DcsBios::StringBuffer<19> cmsp1Buffer(0x1000, onCmsp1Change); void onCmsp2Change(char* newValue) { LCD.sendString(newValue, 0, 1); } DcsBios::StringBuffer<19> cmsp2Buffer(0x1014, onCmsp2Change); void setup() { DcsBios::setup(); Wire.begin(); LCD.init(); } void loop() { DcsBios::loop(); } Then it displayed odd font every time a countermeasure was released. Figured maybe it was screwy due to 2 lines on such a small screen. So I tried this for the F18 Comm channel thinking one digit should work fine... /* 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_DEFAULT_SERIAL #include "DcsBios.h" #include "Wire.h" #include "OLedI2C.h" OLedI2C LCD; /* paste code snippets from the reference documentation here */ void onUfcComm1DisplayChange(char* newValue) { LCD.sendString(newValue, 0, 0); } DcsBios::StringBuffer<2> ufcComm1DisplayBuffer(0x541c, onUfcComm1DisplayChange); void setup() { DcsBios::setup(); Wire.begin(); LCD.init(); } void loop() { DcsBios::loop(); } and the same weird font as I roll the knob. any ideas? Loving the Arduino and DCS Bios world so far but I seem to be pretty dense. I feel using the Adafruit GFX and SSD1306 librarys is the better way to get this done, but theres not many examples with DCS-BIOS to help me along troubleshooting.
-
The 1.4 release seems to be working quite well, no issues so far with other profiles. I was wondering how close we were to getting our hands on your av8 profile BluFin
-
Noob question, I apologize in advance. Loving the set up so far, got the harrier working quicker than I though I would have. 2 questions I have and im sure its a set up error on my end, I cant seem to get any of the lamps to light (no gear indication, master caution) and I set up a monitor config LUA to move mfd exports into position, but the only appear on my bottom monitor if i am not in cockpit view (external or weapon follow both exports I set show on my bottom monitor, Any ideas on what I messed up?
-
Thanks! Not sure what the artifacts are in the screen shots, but being brand new to Helios and exporting displays hopefully some other lost soul can benefit from all my mistakes. Capt Zeen thank you for all your work on this profile, it’s awesome! Now I just need to find a good AV8 equivalent.
-
I’m also very interested in your work blufinbima, I am about 2 days into using Helios but loving what it’s capable of and would really enjoy a great harrier profile. Not sure what I can do but I’m glad to help.
-
-
Got it figured out. For some reason when i first installed everything the profile had all open areas for the exports filled. reinstalled the profiles, could see the desktop through the helios profile and went to work changing locations of the exports. Thanks for all the help
-
I took Capt Zeen's advice and put them all on the horizontal in windows. all are 1920/1080. running 7680/1080 in DCS. I reworked the monitor setup LUA and moved the exports to the correct location, but if I turn on the helios profile it blocks the exports. I'm sure I'm messing up something with the lua, but I'm not sure what. The 4th monitor is the touchscreen for Helios Helios.lua
-
Im sure this has been asked multiple times. Yes I have looked/searched, but im only pulling up old stuff and i'm not very good with LUA's I'm brand new to Helios (and Loving it) but I'm having issues with aligning the exports on the F18 (Capt Zeen Beta). I've only tried editing the left DDI location just to test it and if it had moved down I'd do the rest but im not sure where I'm screwing up. I'm used the running the "3 Monitor" stock profile, but I grabbed the bottom touch screen for Helios and I'm not sure where I'm messing this up. All monitors are running 1920/1080. Please let me know what I need to do to finish this set up. Thanks! 3_monitors-FA18C.lua