Button: Removed grove dependency

* Renamed all files from groverrotary to rotary
    * Replaced all instances of groverrotary with rotary
    * Updated all CMake files

Signed-off-by: Sisinty Sasmita Patra <sisinty.s.patra@intel.com>
This commit is contained in:
Sisinty Sasmita Patra
2016-09-13 12:06:37 -07:00
committed by Noel Eck
parent 6a6a572069
commit 3753a1be5c
20 changed files with 84 additions and 42 deletions

View File

@ -91,7 +91,7 @@ add_example (led)
add_example (relay)
add_example (light)
add_example (temperature)
add_example (grovebutton)
add_example (button)
add_example (rotary)
add_example (slide)
add_example (buzzer-sound)

View File

@ -33,7 +33,7 @@ main(int argc, char **argv)
//! [Interesting]
// Create the button object using GPIO pin 0
upm::GroveButton* button = new upm::GroveButton(0);
upm::Button* button = new upm::Button(0);
// Read the input and print, waiting one second between readings
while( 1 ) {

View File

@ -22,12 +22,12 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
public class GroveButtonSample {
public class ButtonSample {
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
// Create the button object using GPIO pin 2
upm_grove.GroveButton button = new upm_grove.GroveButton(2);
upm_button.Button button = new upm_button.Button(2);
while (true) {
System.out.println(button.name() + " value is " + button.value());
@ -37,4 +37,4 @@ public class GroveButtonSample {
// ! [Interesting]
}
}
}

View File

@ -22,13 +22,13 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
public class GroveButton_intrSample {
public class Button_intrSample {
public static int counter = 0;
public static void main(String[] args) throws InterruptedException {
// ! [Interesting]
upm_grove.GroveButton b = new upm_grove.GroveButton(2);
upm_button.Button b = new upm_button.Button(2);
ButtonISR callback = new ButtonISR();
b.installISR(2, callback);
@ -47,7 +47,7 @@ class ButtonISR implements Runnable {
}
public void run() {
GroveButton_intrSample.counter++;
Button_intrSample.counter++;
System.out.println("Button pressed!");
}
}
}

View File

@ -30,8 +30,8 @@ add_example(CJQ4435Sample cjq4435)
add_example(DS1307Sample ds1307)
add_example(ENC03RSample enc03r)
add_example(ES08ASample servo)
add_example(GroveButtonSample grove)
add_example(GroveButton_intrSample grove)
add_example(ButtonSample button)
add_example(Button_intrSample button)
add_example(Collision collision)
add_example(EHRSample ehr)
add_example(Emg emg)

View File

@ -26,7 +26,7 @@
var groveSensor = require('jsupm_grove');
// Create the button object using GPIO pin 0
var button = new groveSensor.GroveButton(0);
var button = new groveSensor.Button(0);
// Read the input and print, waiting one second between readings
function readButtonValue() {

View File

@ -24,7 +24,7 @@ import time
import pyupm_grove as grove
# Create the button object using GPIO pin 0
button = grove.GroveButton(0)
button = grove.Button(0)
# Read the input and print, waiting one second between readings
while 1: