|
@@ -22,20 +22,20 @@
|
22
|
22
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
23
|
23
|
*/
|
24
|
24
|
|
25
|
|
-public class MY9221_ledbarSample{
|
|
25
|
+public class GroveLEDBar {
|
26
|
26
|
|
27
|
|
- public static void main(String[] args) throws InterruptedException {
|
28
|
|
- //! [Interesting]
|
|
27
|
+ public static void main(String[] args) throws InterruptedException {
|
|
28
|
+ //! [Interesting]
|
29
|
29
|
// Instantiate a Grove LED Bar, with Data pin D8 and Clock pin D9
|
30
|
|
- upm_my9221.MY9221 bar = new upm_my9221.MY9221((short) 8, (short) 9);
|
31
|
|
-
|
32
|
|
- while (true) {
|
33
|
|
- for (short idx = 1; idx < 11; idx++) {
|
34
|
|
- bar.setBarLevel(idx);
|
35
|
|
- Thread.sleep(100);
|
36
|
|
- }
|
37
|
|
- }
|
|
30
|
+ upm_my9221.GroveLEDBar bar = new upm_my9221.GroveLEDBar((short) 8, (short) 9);
|
|
31
|
+
|
|
32
|
+ while (true) {
|
|
33
|
+ for (short idx = 1; idx < 11; idx++) {
|
|
34
|
+ bar.setBarLevel(idx);
|
|
35
|
+ Thread.sleep(100);
|
|
36
|
+ }
|
|
37
|
+ }
|
38
|
38
|
//! [Interesting]
|
39
|
|
- }
|
|
39
|
+ }
|
40
|
40
|
|
41
|
41
|
}
|