rwblinn Well-Known Member Licensed User Longtime User Jan 29, 2017 #1 Hi, wrapping this library. rBigNumbers compiles without error, but when using Code: 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: Code: void Initialize(LiquidCrystal_I2C* lcd); Code: void B4RBigNumbers_I2C::Initialize(LiquidCrystal_I2C* lcd) { bn = new (be) BigNumbers(&lcd); bn->begin(); } Any help appreciated? Libary & Example code attached. Attachments bn.zip bn.zip 5.9 KB · Views: 869
Hi, wrapping this library. rBigNumbers compiles without error, but when using Code: 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: Code: void Initialize(LiquidCrystal_I2C* lcd); Code: void B4RBigNumbers_I2C::Initialize(LiquidCrystal_I2C* lcd) { bn = new (be) BigNumbers(&lcd); bn->begin(); } Any help appreciated? Libary & Example code attached.
Erel B4X founder Staff member Licensed User Longtime User Jan 29, 2017 #2 The type of lcd is B4RLiquidCrystal_I2C*. You can modify the rLiquidCrystal_I2C library and make lcd a public variable. Change your library code to accept a B4RLiquidCrystal_I2C* and get the native object with lcd->lcd
The type of lcd is B4RLiquidCrystal_I2C*. You can modify the rLiquidCrystal_I2C library and make lcd a public variable. Change your library code to accept a B4RLiquidCrystal_I2C* and get the native object with lcd->lcd
rwblinn Well-Known Member Licensed User Longtime User Jan 29, 2017 #3 Thats it - need to polish the library up and will share rBigNumbers_I2C in the B4R Libraries. Thanks for your help.
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 Aug 22, 2018 #4 Hi rwblinn, I'd need to view your rBigNumbers_I2C to understand how you resolved the issue. When can I find it? Thank you
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 Aug 22, 2018 #5 Alpandino said: ...need to view your rBigNumbers_I2C to understand how you resolved the issue. When can I find it? Click to expand... 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 rBigNumbers_I2C.zip 5.1 KB · Views: 829 rLiquidCrystal_I2C.zip rLiquidCrystal_I2C.zip 12.9 KB · Views: 801 b4rhowtolcd1602bignumbers.zip b4rhowtolcd1602bignumbers.zip 375.9 KB · Views: 792
Alpandino said: ...need to view your rBigNumbers_I2C to understand how you resolved the issue. When can I find it? Click to expand... 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).
Alpandino Member Licensed User Aug 22, 2018 #6 Hi rwblinn, thank you a lot. Now what should I do to pass an array of lcd? I tried Code: 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
Hi rwblinn, thank you a lot. Now what should I do to pass an array of lcd? I tried Code: 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 Aug 22, 2018 #7 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.
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.