DCS Bios and Sparkfun Alphanumric display - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 08-02-2020, 04:12 AM   #1
Chickenbone72
Junior Member
 
Join Date: Feb 2018
Location: Tasmania, Australia
Posts: 7
Default DCS Bios and Sparkfun Alphanumric display



I have purchased a 14 segment display https://core-electronics.com.au/qwii...splay-red.html and am having trouble get it to work in dcs for the A-10C TACAN. I am able to use the basic arduino / Sparkfun code and get display to function in arduino. but cant work out how to get it to work in DCS-BIOS. I'll paste what I am working with so far but nothing displaying on display. other arduinos are working fine, so DCS and Bios are installed correctly,

any help or code would be greatly appreciated

i have Arduino mega's , uno's and nano's


/*
Tell DCS-BIOS to use a serial connection and use interrupt-driven
communication. The main program will be interrupted to prioritize
processing incoming data.

This should work on any Arduino that has an ATMega328 controller
(Uno, Pro Mini, many others).
*/
#include <Wire.h>

#include <SparkFun_Alphanumeric_Display.h>

#define DCSBIOS_IRQ_SERIAL

#include "DcsBios.h"

HT16K33 display;

/* paste code snippets from the reference documentation here */

void onTacanChannelChange(char* newValue) {
/* your code here */
display.write(0, newValue[3]);
display.write(1, newValue[2]);
display.write(2, newValue[1]);
display.write(3, newValue[0]);
}
DcsBios::StringBuffer<4> tacanChannelBuffer(0x1162, onTacanChannelChange);

void setup() {
display.begin();
DcsBios::setup();
}

void loop() {
DcsBios::loop();
}
Chickenbone72 is offline   Reply With Quote
Old 08-02-2020, 06:21 PM   #2
BoboBear
Junior Member
 
BoboBear's Avatar
 
Join Date: Jul 2019
Location: UK
Posts: 13
Default

I think you're missing a call to update the display in your loop()

I don't have the Sparkfun display library, but it's probably something like:-

display.writeDisplay();

Take a look at the example sketch with the library
BoboBear is offline   Reply With Quote
Old 08-03-2020, 09:27 AM   #3
Chickenbone72
Junior Member
 
Join Date: Feb 2018
Location: Tasmania, Australia
Posts: 7
Default

cool I'll give it a try, thx
Chickenbone72 is offline   Reply With Quote
Old 08-03-2020, 10:00 AM   #4
Chickenbone72
Junior Member
 
Join Date: Feb 2018
Location: Tasmania, Australia
Posts: 7
Default

Quote:
Originally Posted by BoboBear View Post
I think you're missing a call to update the display in your loop()

I don't have the Sparkfun display library, but it's probably something like:-

display.writeDisplay();

Take a look at the example sketch with the library

this code compiles but no display when connected to DCS Bios

#include <Wire.h>

#include <SparkFun_Alphanumeric_Display.h> //Click here to get the library: http://librarymanager/All#Alphanumeric_Display by SparkFun
HT16K33 display;

#define DCSBIOS_IRQ_SERIAL

#include "DcsBios.h"

/* paste code snippets from the reference documentation here */

void onTacanChannelChange(char* newValue) {
/* your code here */

display.printChar(newValue[0], 0);
display.printChar(newValue[1], 1);
display.printChar(newValue[2], 2);
display.printChar(newValue[3], 3);
display.updateDisplay();

DcsBios::StringBuffer<4> tacanChannelBuffer(0x1162, onTacanChannelChange);
}
void setup() {
Wire.begin(); //Join I2C bus
display.begin();
DcsBios::setup();



}

void loop() {
DcsBios::loop();

}
Chickenbone72 is offline   Reply With Quote
Old 08-03-2020, 10:41 AM   #5
Chickenbone72
Junior Member
 
Join Date: Feb 2018
Location: Tasmania, Australia
Posts: 7
Default

Also tried this one and no info coming up exept the " BIT" i have it printing for 1 sec

#include <SparkFun_Alphanumeric_Display.h> //Click here to get the library: http://librarymanager/All#Alphanumeric_Display by SparkFun
HT16K33 display;

#include <Wire.h>
#define DCSBIOS_IRQ_SERIAL

#include "DcsBios.h"

/* paste code snippets from the reference documentation here */

void onTacanChannelChange(char* newValue) {
/* your code here */

display.print(0, newValue[0]);
display.print(1, newValue[1]);
display.print(2, newValue[2]);
display.print(3, newValue[3]);
display.updateDisplay();

DcsBios::StringBuffer<4> tacanChannelBuffer(0x1162, onTacanChannelChange);
}
void setup() {
Wire.begin(); //Join I2C bus
display.begin();
display.setBrightness(14);
DcsBios::setup();
// write something to the display
// so you see something before data is received
display.print(" BIT");
delay(1000);
display.clear();


}

void loop() {
DcsBios::loop();

}
Chickenbone72 is offline   Reply With Quote
Old 08-03-2020, 02:11 PM   #6
BoboBear
Junior Member
 
BoboBear's Avatar
 
Join Date: Jul 2019
Location: UK
Posts: 13
Default

Quote:
Originally Posted by Chickenbone72 View Post

void onTacanChannelChange(char* newValue) {
/* your code here */

display.print(0, newValue[0]);
display.print(1, newValue[1]);
display.print(2, newValue[2]);
display.print(3, newValue[3]);
display.updateDisplay();

DcsBios::StringBuffer<4> tacanChannelBuffer(0x1162, onTacanChannelChange);
}
Is that a typo?

DcsBios::StringBuffer<4> tacanChannelBuffer(0x1162, onTacanChannelChange);

Should be outside of onTacanChannelChange procedure

Also, I would suggest moving the display.updateDisplay() call to just after DcsBios::loop(). That way if multiple things get updated in one DCSBios update you only write once to the i2c
BoboBear is offline   Reply With Quote
Reply

Tags
alphanumeric display, arduino, dcs bios, help needed

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 02:44 PM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.