spi_ = ioio_.openSpiMaster(4, 4, 5, 6, SpiMaster.Rate.RATE_50K);
public void greenAnimation() throws ConnectionLostException,
InterruptedException {
new Thread(new Runnable() {
public void run() {
int i = 0;
try {
clear(0, 31);
while (i < 25) {
Thread.sleep(25);
if ( i >= 0 && i < 24) {
green(0, i);
}
Thread.sleep(25);
i++;
}
Thread.sleep(20000);
run();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ConnectionLostException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}).start();
}
--
You received this message because you are subscribed to the Google Groups "ioio-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ioio-users+...@googlegroups.com.
To post to this group, send email to ioio-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ioio-users.
For more options, visit https://groups.google.com/groups/opt_out.
spi_ = ioio_.openSpiMaster(39, 4, 5, 6, SpiMaster.Rate.RATE_50K);
try {
for (int i = start; i < end; i++) {
color.clear();
color.r = (byte) 0;
color.g = (byte) 255;
color.b = (byte) 0;
setLed(i, color);
}
ioio_.beginBatch();
try {
spi_.writeReadAsync(0, buffer1_, buffer1_.length,
buffer1_.length, null, 0);
spi_.writeReadAsync(0, buffer2_, buffer2_.length,
buffer2_.length, null, 0);
Thread.sleep(50);
} finally {
ioio_.endBatch();
}
} catch (InterruptedException e1) {
}
Cool. You probably want the sleep outside the batch though.