mirror of
https://github.com/eclipse/upm.git
synced 2025-03-15 04:57:30 +03:00
my9221: fixup groveledbar java example
Signed-off-by: Jon Trulson <jtrulson@ics.com> Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
parent
ac5c20afad
commit
af7f544387
@ -22,20 +22,20 @@
|
|||||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class MY9221_ledbarSample{
|
public class GroveLEDBar {
|
||||||
|
|
||||||
public static void main(String[] args) throws InterruptedException {
|
public static void main(String[] args) throws InterruptedException {
|
||||||
//! [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) {
|
|
||||||
for (short idx = 1; idx < 11; idx++) {
|
|
||||||
bar.setBarLevel(idx);
|
|
||||||
Thread.sleep(100);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//! [Interesting]
|
//! [Interesting]
|
||||||
}
|
// Instantiate a Grove LED Bar, with Data pin D8 and Clock pin D9
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//! [Interesting]
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user