diff --git a/examples/java/A110xSample.java b/examples/java/A110xSample.java index eafb4925..cba6c811 100644 --- a/examples/java/A110xSample.java +++ b/examples/java/A110xSample.java @@ -33,6 +33,8 @@ public class A110xSample { } public static void main(String argv[]) throws InterruptedException { +//! [Interesting] + // Instantiate an A110X sensor on digital pin D2 upm_a110x.A110X a110x = new upm_a110x.A110X(2); while(true) { @@ -43,6 +45,7 @@ public class A110xSample { System.out.println("magnet not detected..."); } Thread.sleep(1000); - } + } +//! [Interesting] } } diff --git a/examples/java/Adxl345.java b/examples/java/Adxl345.java index 5308ea7c..8dfad146 100644 --- a/examples/java/Adxl345.java +++ b/examples/java/Adxl345.java @@ -33,6 +33,8 @@ public class Adxl345 { } public static void main(String argv[]) throws InterruptedException { +//! [Interesting] + // Note: Sensor only works at 3.3V on the Intel Edison with Arduino breakout upm_adxl345.Adxl345 obj = new upm_adxl345.Adxl345(0); int[] raw = new int[3]; float[] accel = new float[3]; @@ -49,5 +51,6 @@ public class Adxl345 { Thread.sleep(1000); } +//! [Interesting] } } diff --git a/examples/java/BISS0001Sample.java b/examples/java/BISS0001Sample.java index bf9d5c21..7d7a4662 100644 --- a/examples/java/BISS0001Sample.java +++ b/examples/java/BISS0001Sample.java @@ -34,6 +34,8 @@ public class BISS0001Sample{ } public static void main(String[] args) throws InterruptedException { +//! [Interesting] + // Instantiate a Grove Motion sensor on GPIO pin D7 upm_biss0001.BISS0001 motion = new upm_biss0001.BISS0001(7); while (true) { @@ -46,6 +48,7 @@ public class BISS0001Sample{ Thread.sleep(1000); } +//! [Interesting] } -} \ No newline at end of file +} diff --git a/examples/java/BuzzerSample.java b/examples/java/BuzzerSample.java index 228434bc..107de523 100644 --- a/examples/java/BuzzerSample.java +++ b/examples/java/BuzzerSample.java @@ -34,6 +34,7 @@ public class BuzzerSample{ } public static void main(String[] args) throws InterruptedException { + //! [Interesting] int chord[] = { upm_buzzer.javaupm_buzzer.DO, upm_buzzer.javaupm_buzzer.RE, @@ -57,8 +58,9 @@ public class BuzzerSample{ Thread.sleep(100); } + //! [Interesting] sound.stopSound(); } -} \ No newline at end of file +} diff --git a/examples/java/CJQ4435Sample.java b/examples/java/CJQ4435Sample.java index 2368ec57..abebf0a5 100644 --- a/examples/java/CJQ4435Sample.java +++ b/examples/java/CJQ4435Sample.java @@ -34,6 +34,7 @@ public class CJQ4435Sample{ } public static void main(String[] args) throws InterruptedException { + //! [Interesting] // Instantiate a CJQ4435 MOSFET on a PWM capable digital pin D3 upm_cjq4435.CJQ4435 mosfet = new upm_cjq4435.CJQ4435(3); @@ -56,6 +57,7 @@ public class CJQ4435Sample{ } Thread.sleep(1000); } + //! [Interesting] } -} \ No newline at end of file +} diff --git a/examples/java/ES08ASample.java b/examples/java/ES08ASample.java index e1d56965..b9dc8e36 100644 --- a/examples/java/ES08ASample.java +++ b/examples/java/ES08ASample.java @@ -35,6 +35,7 @@ public class ES08ASample{ } public static void main(String[] args) throws InterruptedException { + //! [Interesting] upm_servo.ES08A servo = new upm_servo.ES08A(6); // Sets the shaft to 180, then to 90, then to 0, @@ -58,5 +59,6 @@ public class ES08ASample{ servo.setAngle (180); System.out.println("Set angle to 180"); + //! [Interesting] } -} \ No newline at end of file +} diff --git a/examples/java/GUVAS12DSample.java b/examples/java/GUVAS12DSample.java index 8287a9da..14e5220d 100644 --- a/examples/java/GUVAS12DSample.java +++ b/examples/java/GUVAS12DSample.java @@ -29,7 +29,6 @@ public class GUVAS12DSample{ private static final float GUVAS12D_AREF = 5; private static final int SAMPLES_PER_QUERY = 1024; - static { try { System.loadLibrary("javaupm_guvas12d"); @@ -40,7 +39,9 @@ public class GUVAS12DSample{ } public static void main(String[] args) throws InterruptedException { - upm_guvas12d.GUVAS12D volts = new upm_guvas12d.GUVAS12D(3); + //! [Interesting] + // Instantiate a GUVAS12D on analog pin A3 + upm_guvas12d.GUVAS12D volts = new upm_guvas12d.GUVAS12D(3); while (true) { float value = volts.value(GUVAS12D_AREF, SAMPLES_PER_QUERY); @@ -49,6 +50,7 @@ public class GUVAS12DSample{ Thread.sleep(1000); } + //! [Interesting] } -} \ No newline at end of file +} diff --git a/examples/java/GroveButtonSample.java b/examples/java/GroveButtonSample.java index 11427c28..903d81a4 100644 --- a/examples/java/GroveButtonSample.java +++ b/examples/java/GroveButtonSample.java @@ -34,6 +34,7 @@ public class GroveButtonSample{ } public static void main(String[] args) throws InterruptedException { + //! [Interesting] // Create the button object using UART upm_grove.GroveButton button = new upm_grove.GroveButton(0); @@ -42,6 +43,7 @@ public class GroveButtonSample{ Thread.sleep(1000); } + //! [Interesting] } -} \ No newline at end of file +} diff --git a/examples/java/GroveLEDSample.java b/examples/java/GroveLEDSample.java index ea6c969e..97961c20 100644 --- a/examples/java/GroveLEDSample.java +++ b/examples/java/GroveLEDSample.java @@ -33,7 +33,8 @@ public class GroveLEDSample { } public static void main (String args[]) throws InterruptedException { - upm_grove.GroveLed led = new upm_grove.GroveLed(2); + //! [Interesting] + upm_grove.GroveLed led = new upm_grove.GroveLed(2); for (int i = 0; i < 10; ++i) { led.on(); @@ -42,5 +43,6 @@ public class GroveLEDSample { Thread.sleep(1000); } led.delete(); + //! [Interesting] } } diff --git a/examples/java/GroveLightSample.java b/examples/java/GroveLightSample.java index cede39a5..85a17858 100644 --- a/examples/java/GroveLightSample.java +++ b/examples/java/GroveLightSample.java @@ -33,7 +33,8 @@ public class GroveLightSample { } public static void main (String args[]) throws InterruptedException { - upm_grove.GroveLight gl = new upm_grove.GroveLight(2); + //! [Interesting] + upm_grove.GroveLight gl = new upm_grove.GroveLight(2); while (true) { float raw_value = gl.raw_value(); @@ -44,5 +45,6 @@ public class GroveLightSample { Thread.sleep(1000); } + //! [Interesting] } } diff --git a/examples/java/GroveLineFinderSample.java b/examples/java/GroveLineFinderSample.java index f5469298..8f84135b 100644 --- a/examples/java/GroveLineFinderSample.java +++ b/examples/java/GroveLineFinderSample.java @@ -34,7 +34,8 @@ public class GroveLineFinderSample{ } public static void main(String[] args) throws InterruptedException { - // Instantiate a Grove Line Finder sensor on digital pin D2 + //! [Interesting] + // Instantiate a Grove Line Finder sensor on digital pin D2 upm_grovelinefinder.GroveLineFinder finder = new upm_grovelinefinder.GroveLineFinder(2); // check every second for the presence of white detection while(true){ @@ -48,6 +49,7 @@ public class GroveLineFinderSample{ Thread.sleep(1000); } + //! [Interesting] } -} \ No newline at end of file +} diff --git a/examples/java/GroveMoistureSample.java b/examples/java/GroveMoistureSample.java index 555d8245..766a567f 100644 --- a/examples/java/GroveMoistureSample.java +++ b/examples/java/GroveMoistureSample.java @@ -33,8 +33,9 @@ public class GroveMoistureSample{ } public static void main (String args[]) throws InterruptedException { - upm_grovemoisture.GroveMoisture gm = new upm_grovemoisture.GroveMoisture(1); - + //! [Interesting] + upm_grovemoisture.GroveMoisture gm = new upm_grovemoisture.GroveMoisture(1); + while (true) { int moisture_val = gm.value(); String result; @@ -50,5 +51,6 @@ public class GroveMoistureSample{ Thread.sleep(1000); } + //! [Interesting] } } diff --git a/examples/java/GroveRelaySample.java b/examples/java/GroveRelaySample.java index 4453081e..3c6313f2 100644 --- a/examples/java/GroveRelaySample.java +++ b/examples/java/GroveRelaySample.java @@ -33,7 +33,8 @@ public class GroveRelaySample{ } public static void main(String[] args) throws InterruptedException { - // Create the button object using UART + //! [Interesting] + // Create the button object using UART upm_grove.GroveRelay relay = new upm_grove.GroveRelay(5); for( int i = 0 ; i < 3 ; i++ ){ @@ -47,5 +48,6 @@ public class GroveRelaySample{ System.out.println("Relay is off"); Thread.sleep(1000); } + //! [Interesting] } -} \ No newline at end of file +} diff --git a/examples/java/GroveRotarySample.java b/examples/java/GroveRotarySample.java index db969bbe..330faf66 100644 --- a/examples/java/GroveRotarySample.java +++ b/examples/java/GroveRotarySample.java @@ -34,7 +34,8 @@ public class GroveRotarySample{ } public static void main(String[] args) throws InterruptedException { - upm_grove.GroveRotary knob = new upm_grove.GroveRotary(0); + //! [Interesting] + upm_grove.GroveRotary knob = new upm_grove.GroveRotary(0); while (true) { float abs_value = knob.abs_value(); // Absolute raw value @@ -49,6 +50,7 @@ public class GroveRotarySample{ Thread.sleep(3000); } + //! [Interesting] } -} \ No newline at end of file +} diff --git a/examples/java/GroveSlideSample.java b/examples/java/GroveSlideSample.java index 2a169fa4..c689dac3 100644 --- a/examples/java/GroveSlideSample.java +++ b/examples/java/GroveSlideSample.java @@ -33,7 +33,8 @@ public class GroveSlideSample { } public static void main (String args[]) throws InterruptedException { - // Instantiate new grove slide potentiometer on analog pin A0 + //! [Interesting] + // Instantiate new grove slide potentiometer on analog pin A0 upm_grove.GroveSlide slide = new upm_grove.GroveSlide(0); while (true) { @@ -45,5 +46,6 @@ public class GroveSlideSample { Thread.sleep(2500); } + //! [Interesting] } } diff --git a/examples/java/GroveSpeakerSample.java b/examples/java/GroveSpeakerSample.java index 5b92bec7..dabb7935 100644 --- a/examples/java/GroveSpeakerSample.java +++ b/examples/java/GroveSpeakerSample.java @@ -34,7 +34,8 @@ public class GroveSpeakerSample{ } public static void main(String[] args) throws InterruptedException { - // Instantiate a Grove Speaker on digital pin D2 + //! [Interesting] + // Instantiate a Grove Speaker on digital pin D2 upm_grovespeaker.GroveSpeaker speaker = new upm_grovespeaker.GroveSpeaker(2); // Play all 7 of the lowest notes @@ -42,6 +43,7 @@ public class GroveSpeakerSample{ // Play a medium C-sharp speaker.playSound('c', true, "med"); - } + //! [Interesting] + } } diff --git a/examples/java/GroveTempSample.java b/examples/java/GroveTempSample.java index 33ca8cf3..15bfe3f6 100644 --- a/examples/java/GroveTempSample.java +++ b/examples/java/GroveTempSample.java @@ -33,7 +33,8 @@ public class GroveTempSample { } public static void main (String args[]) throws InterruptedException { - upm_grove.GroveTemp temp = new upm_grove.GroveTemp(3); + //! [Interesting] + upm_grove.GroveTemp temp = new upm_grove.GroveTemp(3); for (int i = 0; i < 10; ++i) { @@ -46,5 +47,6 @@ public class GroveTempSample { Thread.sleep(1000); } temp.delete(); + //! [Interesting] } } diff --git a/examples/java/GroveWaterSample.java b/examples/java/GroveWaterSample.java index 535896d6..e20f0701 100644 --- a/examples/java/GroveWaterSample.java +++ b/examples/java/GroveWaterSample.java @@ -34,7 +34,8 @@ public class GroveWaterSample{ } public static void main(String[] args) throws InterruptedException { - // Instantiate a Grove Water sensor on digital pin D2 + //! [Interesting] + // Instantiate a Grove Water sensor on digital pin D2 upm_grovewater.GroveWater water = new upm_grovewater.GroveWater(2); while (true) { @@ -48,7 +49,8 @@ public class GroveWaterSample{ Thread.sleep(1000); } + //! [Interesting] } -} \ No newline at end of file +} diff --git a/examples/java/Jhd1313m1Sample.java b/examples/java/Jhd1313m1Sample.java index 65d36e9e..404c0fb5 100644 --- a/examples/java/Jhd1313m1Sample.java +++ b/examples/java/Jhd1313m1Sample.java @@ -34,7 +34,8 @@ public class Jhd1313m1Sample{ } public static void main(String[] args) throws InterruptedException { - upm_i2clcd.Jhd1313m1 lcd = new upm_i2clcd.Jhd1313m1(1, 0x3E, 0x62); + //! [Interesting] + upm_i2clcd.Jhd1313m1 lcd = new upm_i2clcd.Jhd1313m1(1, 0x3E, 0x62); lcd.setCursor(0,0); lcd.write("Hello World"); @@ -44,7 +45,7 @@ public class Jhd1313m1Sample{ System.out.println("Sleeping for 5 seconds"); Thread.sleep(5000); lcd.clear(); - + //! [Interesting] } -} \ No newline at end of file +} diff --git a/examples/java/MQ303ASample.java b/examples/java/MQ303ASample.java index 9f336b2a..3a567ae6 100644 --- a/examples/java/MQ303ASample.java +++ b/examples/java/MQ303ASample.java @@ -34,7 +34,8 @@ public class MQ303ASample{ } public static void main(String[] args) throws InterruptedException { - // Instantiate an mq303a sensor on analog pin A0 + //! [Interesting] + // Instantiate an mq303a sensor on analog pin A0 // This device uses a heater powered from an analog I/O pin.ยท // If using A0 as the data pin, then you need to use A1, as the heater @@ -57,6 +58,7 @@ public class MQ303ASample{ mq303a.heaterEnable(false); System.out.println("Exiting"); - } + //! [Interesting] + } -} \ No newline at end of file +} diff --git a/examples/java/MY9221Sample.java b/examples/java/MY9221Sample.java index 54f54363..8579c48a 100644 --- a/examples/java/MY9221Sample.java +++ b/examples/java/MY9221Sample.java @@ -34,7 +34,8 @@ public class MY9221Sample{ } public static void main(String[] args) throws InterruptedException { - // Instantiate a Grove LED Bar, with Data pin D8 and Clock pin D9 + //! [Interesting] + // Instantiate a Grove LED Bar, with Data pin D8 and Clock pin D9 upm_my9221.MY9221 bar = new upm_my9221.MY9221((short) 8, (short) 9); while (true) { @@ -43,6 +44,7 @@ public class MY9221Sample{ Thread.sleep(100); } } + //! [Interesting] } -} \ No newline at end of file +} diff --git a/examples/java/NUNCHUCKSample.java b/examples/java/NUNCHUCKSample.java index 0724a98d..29b39199 100644 --- a/examples/java/NUNCHUCKSample.java +++ b/examples/java/NUNCHUCKSample.java @@ -34,7 +34,8 @@ public class NUNCHUCKSample{ } public static void main(String[] args) throws InterruptedException { - // Instantiate a nunchuck controller bus 0 + //! [Interesting] + // Instantiate a nunchuck controller bus 0 upm_nunchuck.NUNCHUCK nunchuck = new upm_nunchuck.NUNCHUCK(0); // always do this first @@ -62,6 +63,7 @@ public class NUNCHUCKSample{ Thread.sleep(1000); } + //! [Interesting] } -} \ No newline at end of file +} diff --git a/examples/java/OTP538USample.java b/examples/java/OTP538USample.java index 46b0de64..9b11e508 100644 --- a/examples/java/OTP538USample.java +++ b/examples/java/OTP538USample.java @@ -35,7 +35,8 @@ public class OTP538USample{ } public static void main(String[] args) throws InterruptedException { - // Instantiate a OTP538U on analog pins A0 and A1 + //! [Interesting] + // Instantiate a OTP538U on analog pins A0 and A1 // A0 is used for the Ambient Temperature and A1 is used for the Object temperature. upm_otp538u.OTP538U temps = new upm_otp538u.OTP538U(0, 1, OTP538U_AREF); @@ -45,5 +46,6 @@ public class OTP538USample{ Thread.sleep(1000); } + //! [Interesting] } -} \ No newline at end of file +} diff --git a/examples/java/RFR359FSample.java b/examples/java/RFR359FSample.java index 09b4d2dc..f1839209 100644 --- a/examples/java/RFR359FSample.java +++ b/examples/java/RFR359FSample.java @@ -34,7 +34,8 @@ public class RFR359FSample{ } public static void main(String[] args) throws InterruptedException { - // Instantiate an RFR359F digital pin D2 + //! [Interesting] + // Instantiate an RFR359F digital pin D2 upm_rfr359f.RFR359F dInterruptor = new upm_rfr359f.RFR359F(2); while(true){ @@ -47,6 +48,7 @@ public class RFR359FSample{ Thread.sleep(100); } + //! [Interesting] } -} \ No newline at end of file +} diff --git a/examples/java/RotaryEncoderSample.java b/examples/java/RotaryEncoderSample.java index 81f24eb4..c6526f19 100644 --- a/examples/java/RotaryEncoderSample.java +++ b/examples/java/RotaryEncoderSample.java @@ -34,7 +34,8 @@ public class RotaryEncoderSample{ } public static void main(String[] args) throws InterruptedException { - // Create the button object using UART + //! [Interesting] + // Create the button object using UART upm_rotaryencoder.RotaryEncoder rotaryencoder = new upm_rotaryencoder.RotaryEncoder(2, 3); while (true) { @@ -42,6 +43,7 @@ public class RotaryEncoderSample{ Thread.sleep(1000); } + //! [Interesting] } -} \ No newline at end of file +} diff --git a/examples/java/TP401Sample.java b/examples/java/TP401Sample.java index 6a7bbca6..83100f75 100644 --- a/examples/java/TP401Sample.java +++ b/examples/java/TP401Sample.java @@ -41,7 +41,8 @@ public class TP401Sample{ } public static void main(String[] args) throws InterruptedException { - // Instantiate new grove air quality sensor on analog pin A0 + //! [Interesting] + // Instantiate new grove air quality sensor on analog pin A0 upm_gas.TP401 airSensor = new upm_gas.TP401(0); System.out.println(airSensor.name()); @@ -63,7 +64,8 @@ public class TP401Sample{ Thread.sleep(100); } + //! [Interesting] } -} \ No newline at end of file +} diff --git a/examples/java/TTP223Sample.java b/examples/java/TTP223Sample.java index f82a80cb..e8507f22 100644 --- a/examples/java/TTP223Sample.java +++ b/examples/java/TTP223Sample.java @@ -34,7 +34,8 @@ public class TTP223Sample{ } public static void main(String[] args) throws InterruptedException { - upm_ttp223.TTP223 touch = new upm_ttp223.TTP223(7); + //! [Interesting] + upm_ttp223.TTP223 touch = new upm_ttp223.TTP223(7); while (true) { if(touch.isPressed()) @@ -44,6 +45,7 @@ public class TTP223Sample{ Thread.sleep(1000); } + //! [Interesting] } -} \ No newline at end of file +} diff --git a/examples/java/YG1006Sample.java b/examples/java/YG1006Sample.java index 624018c1..4194058e 100644 --- a/examples/java/YG1006Sample.java +++ b/examples/java/YG1006Sample.java @@ -34,7 +34,8 @@ public class YG1006Sample{ } public static void main(String[] args) throws InterruptedException { - // Instantiate a yg1006 flame sensor on digital pin D2 + //! [Interesting] + // Instantiate a yg1006 flame sensor on digital pin D2 upm_yg1006.YG1006 flame = new upm_yg1006.YG1006(2); while (true) { @@ -48,6 +49,7 @@ public class YG1006Sample{ Thread.sleep(1000); } + //! [Interesting] } -} \ No newline at end of file +}