C/C++ Question BigNumbers Library need help

rwblinn

Well-Known Member
Licensed User
Longtime User
Hi,

wrapping this library. rBigNumbers compiles without error, but when using
B4X:
bn.Initialize(lcdbn)
receiving error
"can not cast type:{type=liquidcrystal_i2c,rank=0,remoteobject=true} to: {type=liquidcrystal_i2c,rank=0,remoteobject=true}"

Seems that doing following in rBigNumbers.h & cpp is not correct:
B4X:
void Initialize(LiquidCrystal_I2C* lcd);
B4X:
void B4RBigNumbers_I2C::Initialize(LiquidCrystal_I2C* lcd) {
  bn = new (be) BigNumbers(&lcd);
  bn->begin();
}

Any help appreciated?

Libary & Example code attached.
 

Attachments

  • bn.zip
    5.9 KB · Views: 502

rwblinn

Well-Known Member
Licensed User
Longtime User
Thats it - need to polish the library up and will share rBigNumbers_I2C in the B4R Libraries.

Thanks for your help.
 

Alpandino

Member
Licensed User
Hi rwblinn, I'd need to view your rBigNumbers_I2C to understand how you resolved the issue. When can I find it?

Thank you
 

rwblinn

Well-Known Member
Licensed User
Longtime User
...need to view your rBigNumbers_I2C to understand how you resolved the issue. When can I find it?
Please find attached the library rBigNumbers_I2C and modified rLiquidCrystal_I2C.

Can not recall if I have made an example as haven't been using B4R for a while ... think I went to a non I2C solution at that time (see next).

May be of interest, is a non I2C example for a LCD1602 to display big numbers (b4rhowtolcdbignumbers.zip).
 

Attachments

  • rBigNumbers_I2C.zip
    5.1 KB · Views: 444
  • rLiquidCrystal_I2C.zip
    12.9 KB · Views: 433
  • b4rhowtolcd1602bignumbers.zip
    375.9 KB · Views: 430

Alpandino

Member
Licensed User
Hi rwblinn, thank you a lot. :)
Now what should I do to pass an array of lcd?
I tried
B4X:
void Initialize(ArrayB4RLiquidCrystal_I2C* lcd);
an a many other things, but doesn't work, I receive different errors.
Is it possible to pass in a method an array of a non-trivial type?
I mean, I'm able to pass an array of Byte, an array of Int, and so on. But I can't pass an array of a type like lcd or AdafruitNeoPixel.

Bye and thank
 

rwblinn

Well-Known Member
Licensed User
Longtime User
Hi,

afraid can not help further.

Suggestion
  • create a new thread under B4R library questions related to wrapping the C library (you build)
  • share the B4R library code (and the C library with preferrable some examples) developed so far.
May be someone else can help based on that information.

Be aware that there is a AdafruitNeoPixel library.
 
Top