No Output inside function

Hi,
I need help with an OLED 20x2 with US2066 controller. The code is very similar to LCD-codes. But inside a function I have no output to the OLED. The init and prefilling works fine inside setup. My brain is to small for this problem…
Here the code with some comments:

/* CMSP-Display */

#define DCSBIOS_IRQ_SERIAL
#include "OLedI2C.h"
#include <Wire.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 --------------------------
void onCmscTxtJmrChange(char* newValue) {
     //newValue = ("TEST");
     lcd.clear();
     lcd.sendString(newValue,0,0);
}
DcsBios::StringBuffer<8> cmscTxtJmrBuffer(0x1096, onCmscTxtJmrChange);


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

Why is this line

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

not inside a function?

Erik_Baas:
Why is this line

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

not inside a function?

This line calls the function. It works in other things very okay.

Do you have to register the function onCmscTxtJmrChange() as a call back function or how is it being called?

This topic was automatically closed after 120 days. New replies are no longer allowed.