mirror of
https://github.com/eclipse/upm.git
synced 2025-03-15 04:57:30 +03:00
docs: Removed 'Grove' from Comments
Signed-off-by: Suyash Lakhotia <suyashlakhotia@gmail.com> Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
parent
b3991979ad
commit
1aa748e3d6
@ -22,10 +22,10 @@
|
||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
// Load Grove module
|
||||
// Load UPM module
|
||||
var ledSensor = require('jsupm_led');
|
||||
|
||||
// Create the Grove LED object using GPIO pin 2
|
||||
// Create the LED object using GPIO pin 2
|
||||
var led = new ledSensor.Led(2);
|
||||
|
||||
// Print the name
|
||||
|
@ -22,10 +22,10 @@
|
||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
//Load Grove Moisture module
|
||||
//Load UPM module
|
||||
var moisture = require('jsupm_moisture');
|
||||
|
||||
// Instantiate a Grove Moisture sensor on analog pin A0
|
||||
// Instantiate a Moisture sensor on analog pin A0
|
||||
var myMoistureObj = new moisture.Moisture(0);
|
||||
|
||||
// Values (approximate):
|
||||
@ -33,8 +33,7 @@ var myMoistureObj = new moisture.Moisture(0);
|
||||
// 300-600, sensor in humid soil
|
||||
// 600+, sensor in wet soil or submerged in water
|
||||
// Read the value every second and print the corresponding moisture level
|
||||
setInterval(function()
|
||||
{
|
||||
setInterval(function() {
|
||||
var result;
|
||||
var moisture_val = parseInt(myMoistureObj.value());
|
||||
if (moisture_val >= 0 && moisture_val < 300)
|
||||
@ -47,8 +46,7 @@ setInterval(function()
|
||||
}, 1000);
|
||||
|
||||
// Print message when exiting
|
||||
process.on('SIGINT', function()
|
||||
{
|
||||
process.on('SIGINT', function() {
|
||||
console.log("Exiting...");
|
||||
process.exit(0);
|
||||
});
|
||||
|
@ -23,26 +23,24 @@
|
||||
*/
|
||||
|
||||
var voltageDivider = require('jsupm_vdiv');
|
||||
// Instantiate a Grove Voltage Divider sensor on analog pin A0
|
||||
// Instantiate a Voltage Divider sensor on analog pin A0
|
||||
var myVoltageDivider = new voltageDivider.VDiv(0);
|
||||
|
||||
// collect data and output measured voltage according to the setting
|
||||
// of the scaling switch (3 or 10)
|
||||
var val, gain3val, gain10val;
|
||||
function getVoltageInfo()
|
||||
{
|
||||
|
||||
function getVoltageInfo() {
|
||||
val = myVoltageDivider.value(100);
|
||||
gain3val = myVoltageDivider.computedValue(3, val);
|
||||
gain10val = myVoltageDivider.computedValue(10, val);
|
||||
console.log("ADC value: " + val + " Gain 3: " + gain3val
|
||||
+ "v Gain 10: " + gain10val + "v");
|
||||
console.log("ADC value: " + val + " Gain 3: " + gain3val + "v Gain 10: " + gain10val + "v");
|
||||
}
|
||||
|
||||
setInterval(getVoltageInfo, 1000);
|
||||
|
||||
// Print message when exiting
|
||||
process.on('SIGINT', function()
|
||||
{
|
||||
process.on('SIGINT', function() {
|
||||
myVoltageDivider = null;
|
||||
voltageDivider.cleanUp();
|
||||
voltageDivider = null;
|
||||
|
@ -22,15 +22,14 @@
|
||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
// Load Grove module
|
||||
// Load UPM module
|
||||
var waterSensor = require('jsupm_water');
|
||||
|
||||
// Instantiate a Water sensor on digital pin D2
|
||||
var water = new waterSensor.Water(2);
|
||||
|
||||
// Read whether the sensor is wet/dry, waiting one second between readings
|
||||
function readWaterState()
|
||||
{
|
||||
function readWaterState() {
|
||||
if (water.isWet())
|
||||
console.log("Sensor is wet");
|
||||
else
|
||||
@ -39,8 +38,7 @@ function readWaterState()
|
||||
setInterval(readWaterState, 1000);
|
||||
|
||||
// Print message when exiting
|
||||
process.on('SIGINT', function()
|
||||
{
|
||||
process.on('SIGINT', function() {
|
||||
console.log("Exiting...");
|
||||
process.exit(0);
|
||||
});
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
var waterFlow_lib = require('jsupm_wfs');
|
||||
|
||||
// Instantiate a Grove Water Flow Sensor on digital pin D2
|
||||
// Instantiate a Water Flow Sensor on digital pin D2
|
||||
var myWaterFlow_obj = new waterFlow_lib.WFS(2);
|
||||
|
||||
// set the flow counter to 0 and start counting
|
||||
@ -33,8 +33,7 @@ myWaterFlow_obj.startFlowCounter();
|
||||
|
||||
|
||||
var millis, flowCount, fr;
|
||||
var myInterval = setInterval(function()
|
||||
{
|
||||
var myInterval = setInterval(function() {
|
||||
// we grab these (millis and flowCount) just for display
|
||||
// purposes in this example
|
||||
millis = myWaterFlow_obj.getMillis();
|
||||
@ -53,8 +52,7 @@ var myInterval = setInterval(function()
|
||||
|
||||
|
||||
// When exiting: clear interval and print message
|
||||
process.on('SIGINT', function()
|
||||
{
|
||||
process.on('SIGINT', function() {
|
||||
clearInterval(myInterval);
|
||||
myWaterFlow_obj.stopFlowCounter();
|
||||
myWaterFlow_obj = null
|
||||
|
Loading…
x
Reference in New Issue
Block a user