2015-09-08 21:58:36 +03:00
|
|
|
/*
|
|
|
|
|
* Author: Stefan Andritoiu <stefan.andritoiu@intel.com>
|
|
|
|
|
* Copyright (c) 2015 Intel Corporation.
|
|
|
|
|
*
|
2019-07-30 19:41:32 -07:00
|
|
|
* 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.
|
2015-09-08 21:58:36 +03:00
|
|
|
*
|
2019-07-30 19:41:32 -07:00
|
|
|
* SPDX-License-Identifier: MIT
|
2015-09-08 21:58:36 +03:00
|
|
|
*/
|
|
|
|
|
|
2018-02-27 12:12:09 -08:00
|
|
|
public class GroveLEDBar_Example {
|
2015-09-08 21:58:36 +03:00
|
|
|
|
2016-01-29 18:17:26 -07:00
|
|
|
public static void main(String[] args) throws InterruptedException {
|
|
|
|
|
//! [Interesting]
|
2015-09-14 18:13:40 +03:00
|
|
|
// Instantiate a Grove LED Bar, with Data pin D8 and Clock pin D9
|
2016-01-29 18:17:26 -07:00
|
|
|
upm_my9221.GroveLEDBar bar = new upm_my9221.GroveLEDBar((short) 8, (short) 9);
|
|
|
|
|
|
|
|
|
|
while (true) {
|
|
|
|
|
for (short idx = 1; idx < 11; idx++) {
|
|
|
|
|
bar.setBarLevel(idx);
|
|
|
|
|
Thread.sleep(100);
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-09-14 18:13:40 +03:00
|
|
|
//! [Interesting]
|
2016-01-29 18:17:26 -07:00
|
|
|
}
|
2015-09-08 21:58:36 +03:00
|
|
|
|
2015-09-14 18:13:40 +03:00
|
|
|
}
|