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
/*jslint node: true */ | |
"use strict"; | |
// Setup the modules we need to use | |
var spark = require('spark'); | |
var fs = require('fs'); | |
// Login and start doing things! | |
spark.on('login', function() { | |
//Get test event for specific core |
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
// -------------------------------------------- // | |
// Documentation | |
// ------------------ | |
// -------------------------------------------- // | |
// Compiler Defines | |
// ------------------ | |
#define APP_VERSION 1.2 // Keep track of what version this code is | |
#define NUM_MEASUREMENTS 20 // The number of measurements we want to take befoe averaging and publishing |
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
#define APP_VERSION 1.1 | |
double distance = 0; | |
double echo = 0; | |
int ultraSoundSignal = D0; // Ultrasound signal pin | |
// Elapsed Millis Stuff | |
unsigned int publishInterval = 2000; // Every 2000 ms (2 seconds) | |
elapsedMillis timeElapsed; //declare global if you don't want it reset every time loop runs |