Created
July 2, 2014 23:45
-
-
Save richard-to/eaa10f06f550a7ae4bf8 to your computer and use it in GitHub Desktop.
Quick and dirty script to generate fake sensor data for testing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function r(min, max) { | |
return Math.floor(Math.random() * (max - min + 1)) + min; | |
} | |
var type = 's'; | |
var start_time = 1404313860; | |
var interval = 2; | |
var readings = 10; | |
for (var g = 0; g < 10; g++) | |
{ | |
var message = type + " " + start_time + " " + r(50, 180) + " " + r(18,23); | |
for (var i = 1; i < readings; ++i) | |
{ | |
start_time += (interval * 60); | |
message += ";" + (interval * i) + " " + r(50, 180) + " " + r(18,23); | |
} | |
start_time += (4 * 60) | |
console.log(message); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment