AMS, Franklin Lightning Sensor "AS3935" Library
You are viewing an older revision! See the latest version
Homepage
AMS, Franklin Lightning Sensor "AS3935" Library¶
Sample¶
for LPC1114
main.cpp
#include "mbed.h" #include "AS3935.h" Serial pc(USBTX, USBRX); I2C i2c(dp5, dp27); AS3935 as(i2c, dp26); void lightning () { int energy, distance; as.read(energy, distance); pc.printf("Lightning energy=%d distance=%d\r\n", energy, distance); } int main() { pc.baud(115200); pc.printf("*** AS3935\r\n"); as.init(); as.attach(&lightning); for (;;); }