/* * Author: Sarah Knepper * Copyright (c) 2014 Intel Corporation. * * This program and the accompanying materials are made available under the * terms of the The MIT License which is available at * https://opensource.org/licenses/MIT. * * SPDX-License-Identifier: MIT */ // Load UPM module var upm = require('jsupm_button'); // Create the button object using GPIO pin 0 var button = new upm.Button(0); // Read the input and print, waiting one second between readings function readButtonValue() { console.log(button.name() + " value is " + button.value()); } setInterval(readButtonValue, 1000);