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
'use strict' | |
// https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options | |
const spawn = require('child_process').spawnSync | |
// object returned when process has completely exited | |
const child = spawn('which', ['node'] ) | |
// view status | |
console.log( child.status ) |
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
// Tessel Wifi & Network Test | |
// Author: Daniel Christopher <[email protected]> | |
// Public Domain | |
// | |
// 1- Attempt to connect to Internet, retry as necessary | |
// 2- Make an HTTP GET | |
// | |
// Combines Tessel [wifi examples](http://start.tessel.io/wifi) | |
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
// Tessel Delay | |
// Author: Daniel Christopher <[email protected]> | |
// Public Domain | |
// | |
// Halt script execution for given number of microseconds. | |
// Inspired by Arduino's built-in delay(). | |
// | |
// Those already working with Javascript are likely to use setTimeout. | |
console.log("\nDoing something..."); |
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
// Terminate a Tessel Script | |
// Author: Daniel Christopher <[email protected]> | |
// Public Domain | |
// | |
// To stop a script running on the Tessel, simply `return` in the global scope | |
console.log("Hello"); | |
delay(5000); | |
console.log("Goodbye"); |