Thanks. Files attached. Please remember this is my first serious piece of JS - feedback appreciated :)
My current test code for using it looks like this:
var Date=require("http://192.168.0.12/date.js").constructor;
var Clock2=require("http://192.168.0.12/clock.js").constructor;
print("hello");
print(Clock2);
var clk=new Clock2(2014,15,4,23,57,0,0);
function showClock() {
print(clk.getClockTime().toString());
}
setInterval(showClock,1000);
The result on running:
Date Module - Loading...
Before date fn
After date fn
getDayssinceepoch
setDayssinceepoch
Done Loading Clock Module
Date Module - Loaded.
Clock Module - Loading
xLoading Date
xDone loading Date
ERROR: Using '.' operator on non-object at line 66 col 29
print("Clock module - Loaded.");
^
ERROR: Got String:');
' expected ID at line 66 col 31
print("Clock module - Loaded.");
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Gordon
Thanks. Files attached. Please remember this is my first serious piece of JS - feedback appreciated :)
My current test code for using it looks like this:
The result on running:
Date Module - Loading...
Before date fn
After date fn
getDayssinceepoch
setDayssinceepoch
Done Loading Clock Module
Date Module - Loaded.
Clock Module - Loading
xLoading Date
xDone loading Date
ERROR: Using '.' operator on non-object at line 66 col 29
print("Clock module - Loaded.");
ERROR: Got String:');
' expected ID at line 66 col 31
print("Clock module - Loaded.");
hello
undefined
ERROR: Constructor should be a function at line 1 col 161
var Date=require("http://192.168.0.12/date.js").constructor,Clock2=require("http://192.168.0.12/clock.js").constructor;print("hello");print(Clock2);var clk=new Clock2(2014,15,4,23,57,0,0);function showClock(){print(clk.getClockTime().toString())}setInterval(showClock,1E3);
Throttle sending is ON. Minify is set to 'simple optimisations'
Martin
2 Attachments