mirror of
https://github.com/eclipse/upm.git
synced 2025-03-15 04:57:30 +03:00
java: Corrected Java button sample and added it to auto build examples
Signed-off-by: Stefan Andritoiu <stefan.andritoiu@intel.com> Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
parent
757a2ce342
commit
71b0791239
@ -29,6 +29,7 @@ add_example(DS1307Sample ds1307)
|
|||||||
add_example(ENC03RSample enc03r)
|
add_example(ENC03RSample enc03r)
|
||||||
add_example(ES08ASample servo)
|
add_example(ES08ASample servo)
|
||||||
add_example(GroveButtonSample grove)
|
add_example(GroveButtonSample grove)
|
||||||
|
add_example(GroveButton_intrSample grove)
|
||||||
add_example(GroveCollision grovecollision)
|
add_example(GroveCollision grovecollision)
|
||||||
add_example(GroveEHRSample groveehr)
|
add_example(GroveEHRSample groveehr)
|
||||||
add_example(GroveEmg groveemg)
|
add_example(GroveEmg groveemg)
|
||||||
|
@ -22,9 +22,6 @@
|
|||||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import upm_grove.IsrCallback;
|
|
||||||
|
|
||||||
//NOT TESTED!!!
|
|
||||||
public class GroveButton_intrSample {
|
public class GroveButton_intrSample {
|
||||||
|
|
||||||
public static int counter = 0;
|
public static int counter = 0;
|
||||||
@ -33,8 +30,8 @@ public class GroveButton_intrSample {
|
|||||||
// ! [Interesting]
|
// ! [Interesting]
|
||||||
upm_grove.GroveButton b = new upm_grove.GroveButton(2);
|
upm_grove.GroveButton b = new upm_grove.GroveButton(2);
|
||||||
|
|
||||||
IsrCallback callback = new ButtonISR();
|
ButtonISR callback = new ButtonISR();
|
||||||
b.installISR(mraa.Edge.EDGE_RISING.swigValue(), callback);
|
b.installISR(2, callback);
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
System.out.println("Counter: " + counter);
|
System.out.println("Counter: " + counter);
|
||||||
@ -44,7 +41,7 @@ public class GroveButton_intrSample {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ButtonISR extends IsrCallback {
|
class ButtonISR implements Runnable {
|
||||||
public ButtonISR() {
|
public ButtonISR() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user