• Updated Version 2 May 2016
    allObjects gave me some pointers about object constructors, making the object methods exist only once for the object and not in each instance and the use of the keyword “bind” when starting intervals.
    http://forum.espruino.com/conversations/286055/
    These lessons are applied to this project.
    It has been pointed out that using eval() is a security problem. Having commands in the object being shipped over an open channel is also a security problem. I hope to further rework this code to address this issue.
    The output:

    >echo(0);
    N,Date,Time,A0,A1,A2,A3,Board Temp C,Board Temp F,
    Test End
    =undefined
    1, 2 4 2016, 14:51:40, 0.81, 31.39, 0.73, 0.71, 35.39, 95.33
    2, 2 4 2016, 14:51:41, 0.80, 32.57, 0.74, 0.72, 35.37, 95.33
    3, 2 4 2016, 14:51:42, 0.82, 33.57, 0.75, 0.72, 35.37, 95.33
    4, 2 4 2016, 14:51:43, 0.85, 34.69, 0.75, 0.72, 35.39, 94.88
    5, 2 4 2016, 14:51:44, 0.87, 35.77, 0.76, 0.73, 35.18, 95.27
    6, 2 4 2016, 14:51:45, 0.87, 35.79, 0.76, 0.73, 35.18, 95.33
    7, 2 4 2016, 14:51:46, 0.88, 36.50, 0.76, 0.73, 35.18, 95.27
    8, 2 4 2016, 14:51:47, 0.88, 36.94, 0.76, 0.73, 35.39, 96.10
    9, 2 4 2016, 14:51:48, 0.88, 37.35, 0.77, 0.73, 35.18, 95.27
    10, 2 4 2016, 14:51:49, 0.89, 37.26, 0.77, 0.73, 35.58, 95.66
    >
    
    

    Testlog8.js is attached.


    1 Attachment

About