Sub Process_Globals
'These global variables will be declared once when the application starts.
'Public variables can be accessed from all modules.
Public Serial1 As Serial
Dim time As String
Dim timer1 As Timer
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
timer1.Initialize("timer1_Tick",1000)
Log("AppStart")
timer1.Enabled=True
End Sub
Sub timer1_tick
RunNative("getTimeStr", Null)
Log("Time: ",time)
End Sub
#if C
#include <DS1307.h> // DS1307 RTC Clock library
DS1307 rtc(5, 4);
// Get Time string
char* getTimeStr(B4R::Object* unused) {
char* time = rtc.getTimeStr();
b4r_main::_time = time;
}
#End if