embeddedadventures / MOD-1016

Source and examples for talking to the MOD-1016 AS3935 lightning sensor module
http://www.embeddedadventures.com/as3935_lightning_sensor_module_mod-1016.html
13 stars 6 forks source link

ino file doesn't work create.auduino.cc #5

Closed kevkearney closed 7 years ago

kevkearney commented 7 years ago

I can get the project to compile in the Arduino thick app, but their cloud IDE seems to have a couple of issues. The first one is that the AS3935.h library conflicts with one of the same name in their core libraries. I changed the name just to see if it works, and I ran into some other errors. Note: I renamed the library AS3935mod.cpp to avoid the conflict.

/tmp/792930693/custom/MOD-1016-master/AS3935mod.cpp:41:10: error: 'sgn32' does not name a type volatile sgn32 pulse = 0; ^ /tmp/792930693/custom/MOD-1016-master/AS3935mod.cpp:42:1: error: 'sgn32' does not name a type sgn32 cap_frequencies[16]; ^ /tmp/792930693/custom/MOD-1016-master/AS3935mod.cpp: In function 'void pulseDetected()': /tmp/792930693/custom/MOD-1016-master/AS3935mod.cpp:46:3: error: 'pulse' was not declared in this scope pulse++; ^ /tmp/792930693/custom/MOD-1016-master/AS3935mod.cpp: At global scope: /tmp/792930693/custom/MOD-1016-master/AS3935mod.cpp:49:19: error: variable or field 'autoTuneCaps' declared void void autoTuneCaps(uns8 irq) { ^ /tmp/792930693/custom/MOD-1016-master/AS3935mod.cpp:49:19: error: 'uns8' was not declared in this scope /tmp/792930693/custom/MOD-1016-master/AS3935mod.cpp:58:1: error: 'sgn32' does not name a type sgn32 getFrequency(uns8 irq) { ^ /tmp/792930693/custom/MOD-1016-master/AS3935mod.cpp:70:22: error: variable or field 'freqPerTuneCaps' declared void void freqPerTuneCaps(uns16 fdiv, uns8 irq) { ^ /tmp/792930693/custom/MOD-1016-master/AS3935mod.cpp:70:22: error: 'uns16' was not declared in this scope /tmp/792930693/custom/MOD-1016-master/AS3935mod.cpp:70:34: error: 'uns8' was not declared in this scope void freqPerTuneCaps(uns16 fdiv, uns8 irq) { ^ exit status 1

dr4nc3s commented 7 years ago

Was the header file also renamed to AS3935mod.h?

kevkearney commented 7 years ago

Yes it was.

You can check out the sketch here: https://create.arduino.cc/editor/kevkearney/e0a4a696-eb44-4291-b22c-f7dcc7552cbc/preview

dr4nc3s commented 7 years ago

I just tried it and made the same modifications: renamed the header and cpp files to "AS3935mod" and modified `#ifndef __AS3935_h

define __AS3935_h`

to `#ifndef__AS3935mod_h

define __AS3935mod_h`

Made the same modification in the #include line in the .cpp file. It works fine for me. Can you show me the library file modifications you made?

kevkearney commented 7 years ago

Yup, you are right. I missed a change. It works now. Do you know of any way to change the name to not conflict with the other AS3935 library? Or should this remain a manual change.

dr4nc3s commented 7 years ago

I think it'd be better to keep it as a manual change.