Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for(int l=0; l<4;l++) {
- final int iteration= l;
- i2cModule.writeData((byte) 0x34, (byte) 0x00, new byte[]{(byte) 0xA0, (byte) 0x13});
- i2cModule.readData((byte)0x34, (byte)0xA0, (byte)4).onComplete(new CompletionHandler<byte[]>() {
- @Override
- public void success(byte[] result) {
- // Handle V1 here
- i2cModule.writeData((byte) 0x34, (byte) 0x00, new byte[]{(byte) 0xA1, (byte) 0x13});
- i2cModule.readData((byte)0x34, (byte)0xA1, (byte)4).onComplete(new CompletionHandler<byte[]>() {
- @Override
- public void success(byte[] result) {
- // Handle V2 here
- if (iteration == 3) {
- // compute averages
- // update chart
- }
- }
- });
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement