Jump to content

Recommended Posts

Posted

Guys,

 

I have the below LCD, and an Uno. I am trying to make it work but I can’t even get it to display. I uploaded a sketch just fine but I get no display. Am I missing a component? A backpack?

 

I have successfully used Arduinos to get switches to work but this is my first lcd. Thanks for the help.

 

Gary

CB7E336A-BA3F-4B32-823A-336842799C33.thumb.jpeg.8821dbd926b7f532f332778226d59da6.jpeg

FA0D7D26-7A07-4367-811A-DFB0CD3BA480.thumb.jpeg.f7a29d3d6ce21b097366dbd9f9613603.jpeg

Posted

Thanks! I’m following your example but I will admit I don’t know what I’m doing. I can get the arduino monitor to recognize the lcd but can’t get anything to display.

Posted
My example? Which one to be precise?

 

Sorry, I mean your RS485 with the MAX487 chips. I have all that in order but I am not feeling confident if I can’t even get this screen to light up. Lol.

Posted

Alright lets start with getting the display online. First of all you need to wire it correctly. In the pictures you posted there isn't any wires on but they

 

Display Uno

Vcc 5V

GND GND

SCL A5 (SCL)

SDA A4 (SDA)

 

Since you can compile I assume that you have the OLED library installed?

 

This code should work;

 

/*
 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();
}

 

 

I can get the arduino monitor to recognize the lcd but can’t get anything to display.

I don't really understand this. Are you talking Serial Monitor?

 

As for the RS485 I can't help you at the moment as I am waiting for parts to figure out why I can't get a second Mega running as Master.

 

Cheers

Hans

  • Like 1
Posted

Since you can compile I assume that you have the OLED library installed?

 

:doh: I used the led library. That is probably my first mistake (besides thinking that I could figure this out). I'll find the OLED library and use that.

 

I don't really understand this. Are you talking Serial Monitor?

 

Yes I was able to get the address of 0x3c. I appreciate the help and hopefully this helps someone who is like me and has never attempted anything like this before.

  • 1 year later...
Posted (edited)

Hans, I have a 16 x 2 character LCD display driven by a PCF8574T board at the back, and just tried your sketch to no avail. Do I need to use a different library for that, the connections you state above are the same (using Arduino Uno)

 

Cheers

 

Les

Edited by lesthegrngo
Posted

Thanks, Hans.

 

I'm scouring the net for some step by step tutorials to try and teach myself the basics for these types of sketches, I feel embarrassed at having to ask such basic questions!

 

Cheers

 

Les

Posted

I'm very pleased to report that I got one of my two 16 x LCD modules working great with DCS BIOS. One is a simple 1602A LCD module with the 16 pin output at the top, the other is the same module but with the PCF8574T 'backpack' module attached.

 

The one without the backpack module is the one that I have working, so paradoxically the one with the extra to simplify it actually does the reverse!

 

Nevertheless, I am quite pleased with myself that I have got the TACAN, ILS, CMSC and CMSP all working great with the simple LCD module! As the LCD modules are cheap, it isn't worth the bother to try with the other module, I'll just get a load of the 1602A modules and run with that.

 

Now a really stupid question - why are the orange, green and red 602A modules all three times the price of the blue ones....?

 

Cheers

 

Les

Posted (edited)

Did you try the LiquidCrystal_I2C library to talk to the PCF Chip?

Edited by Vinc_Vega

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Posted

Well, I might be struggling with the RS485 setup, but I managed to figure this out. I downloaded the LiquidCrystal_PCF8574 library, and after playing around with it for a while I have managed to get it working

 

For anyone with one of these LCD modules with the PCF8574 backpack, this is the sketch I managed to get working

 

#include <Wire.h>

#include <LiquidCrystal_PCF8574.h>

#define DCSBIOS_IRQ_SERIAL

 

#include <DcsBios.h>

 

LiquidCrystal_PCF8574 lcd(0x27); // set the LCD address to 0x27 for a 16 chars and 2 line display

 

int show;

 

 

void onCmscTxtJmrChange(char* newValue) {

lcd.setCursor(0, 0);

lcd.print(newValue);

}

DcsBios::StringBuffer<8> cmscTxtJmrBuffer(0x1096, onCmscTxtJmrChange);

 

void onCmscTxtChaffFlareChange(char* newValue) {

lcd.setCursor(4, 0);

lcd.print(newValue);

}

DcsBios::StringBuffer<8> cmscTxtChaffFlareBuffer(0x108e, onCmscTxtChaffFlareChange);

 

void onCmscTxtMwsChange(char* newValue) {

lcd.setCursor(0, 1);

lcd.print(newValue);

}

DcsBios::StringBuffer<8> cmscTxtMwsBuffer(0x12b0, onCmscTxtMwsChange);

 

void setup() {

lcd.begin(16, 2);

lcd.clear();

DcsBios::setup();

 

}

 

void loop() {

DcsBios::loop();

lcd.setBacklight(255);

}

 

 

hope this helps someone!

 

Cheers

 

Les

  • 2 weeks later...
Posted

Dear Pavespawn, please be so kind to get me a link to screen which you used. How can I find it? I need a screen like this: with a small rim to embed it in my panels.

 

Отправлено с моего ZB602KL через Tapatalk

  • 1 year later...
Posted

I'm here with a similar problem. The Code looks clean, but inside the function is like a closed castle. Nothing will work inside. I tried four libraries with the same result. This happens in further codes 😞
Need help!
 

/* CMSP-Display */

#define DCSBIOS_IRQ_SERIAL

#include <Wire.h>
#include "OLedI2C.h"
#include <DcsBios.h>
OLedI2C lcd;


// The output to the 20 x 2 OLED works fine her in the setup area:
void setup() {
  DcsBios::setup();
  Wire.begin();
   //lcd.setContrast(0x0A); // contrast as 0x00 to 0xFF
  lcd.init();
  lcd.sendString("sby air ",0,0);
  lcd.sendString("c---f---",12,0);
  lcd.sendString("active",0,1);
  delay(999);
}


// Here the function without any output:
//Jammer Display --------------------------
 char onCmscTxtJmrChange(char* newValue) {
     lcd.clear();
     lcd.sendString(newValue,0,0);
}
DcsBios::StringBuffer<8> cmscTxtJmrBuffer(0x1096, onCmscTxtJmrChange);


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

 

  • 2 years later...
Posted

The follow works fine with Hello World etc, but can't get it to work with DCS-BIOS. What am I missing, any help apricated?

#define DCSBIOS_IRQ_SERIAL
 
#include "DcsBios.h"
#include <Wire.h>
#include <hd44780.h>                       // main hd44780 header
#include <hd44780ioClass/hd44780_I2Cexp.h> // i2c expander i/o class header
 
// Include Adafruit SI1145 Library
#include <Adafruit_SI1145.h>
 
// declare lcd object: auto locate & auto config expander chip
hd44780_I2Cexp lcd;
 
// Define object uv
Adafruit_SI1145 uv = Adafruit_SI1145();
 
// DCS-DIOS Radio frequency change for A-10II
void onUhfFrequencyChange(char* newValue) {
    lcd.setCursor(0,0);
    lcd.print(newValue);
}
 
DcsBios::StringBuffer<7> uhfFrequencyBuffer(0x1180, onUhfFrequencyChange);
 
void setup() {
  lcd.begin(16,2);
  lcd.clear();
  DcsBios::setup();
 }
 
void loop() {
  DcsBios::loop();
}
Posted (edited)

As your UV sensor seems to be connected to the I2C bus too, you may include the LCD expander's address into the constructor.

Something like this

hd44780_I2Cexp lcd(0x27);

Regards, Vinc

Edited by Vinc_Vega

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...