Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: AS3935 AdafruitGPS SDFileSystem TSI mbed ConfigFile
Diff: main.cpp
- Revision:
- 12:7c58c7a6b25c
- Parent:
- 10:499140eb469b
- Parent:
- 11:a4096e656762
- Child:
- 13:3d717008645c
--- a/main.cpp Wed Jul 01 19:03:20 2015 +0000
+++ b/main.cpp Wed Jul 01 19:39:05 2015 +0000
@@ -9,7 +9,7 @@
#include "time.h"
#include <string>
-#define FW_VER 3
+#define FW_VER 4
// frdm-kl25z as3935 connections for spi1
// ------------------------------------------------
@@ -76,6 +76,9 @@
void DetectLightning()
{
+ /* After the signal IRQ goes high the external
+ unit should wait 2ms before reading the interrupt register. */
+ wait_ms(2);
OriginInt = ld.interruptSource();
gDistance = ld.lightningDistanceKm();
energy = ld.getEnergy();
@@ -113,7 +116,7 @@
// write to the current log file
char time_str[32];
time_t seconds = time(NULL);
- seconds -= 14400; // 14400 = 60*60*4, kludgy way of setting edt
+ seconds -= 14400; // 14400 = 60*60*4, kludgy way of setting est
struct tm *tminfo = localtime(&seconds);
strftime(time_str, 32, "%m/%d/%Y,%T", tminfo);
fprintf(fp,"%s,%ld,",time_str,seconds);