Created Mon, 29 Jun 2015 17:04:35 +0000 by ryabsley
Mon, 29 Jun 2015 17:04:35 +0000
When I try and 'verify" this sketch : P4_LightMeter.pde
I get the following error :
sketch_jun29a.cpp: In function 'void Disp_Data()': sketch_jun29a.cpp:103:20: error: invalid conversion from 'int' to 'const char*' sketch_jun29a.cpp:103:20: error: initializing argument 1 of 'String& String::operator=(const char*)' sketch_jun29a.cpp:113:29: error: invalid conversion from 'int' to 'const char*' sketch_jun29a.cpp:113:29: error: initializing argument 1 of 'String& String::operator=(const char*)' sketch_jun29a.cpp:138:31: error: invalid conversion from 'int' to 'const char*' sketch_jun29a.cpp:138:31: error: initializing argument 1 of 'String& String::operator=(const char*)'
I do have the chipKIT IOShield Library installed in
and was able to successfully compile the pulse meter sketch. This one however is giving an error.
p.s., is there a way and/or should I be marking a post as resolved / or not ? if so I did not see how.
thanks very much.
Mon, 29 Jun 2015 21:57:55 +0000
Hopefully this will help you. You might still need to make some changes from here but it will compile and load correctly (W/m^2 will most likely output a longer more accurate number).
Change : Lux_num = int(Lux); To this : Lux_num = String(Lux);
Change : FtCd_num = int(FtCd1000)/1000; To this : FtCd_num = String((FtCd1000)/1000);
Change : Watt_num = int(Wattm21000)/1000; To this : Watt_num = String((Wattm21000)/1000);
Also, then you can comment out (or remove) the following (this is repeated twice in the code so comment out all 8 of them):
IOShieldOled.putString("."); // Print decimal symbol IOShieldOled.putChar(hundreds); IOShieldOled.putChar(tens); IOShieldOled.putChar(ones);
Let me know if you would like a better explanation or the entire code file if you still have problems.
Tue, 30 Jun 2015 17:01:23 +0000
This is GREAT ! thanks very much.
I think this should do it. When I get a chance I shall try thiese changes and let you know how things went.
Thu, 02 Jul 2015 18:06:19 +0000
ok great. We made the changes you suggested and the code compiled just fine.
Thanks so much djgardn2 :)