Skip to content

Commit a0d1772

Browse files
authored
Update Nunchuk.h
1 parent 8b14763 commit a0d1772

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

Wii-Nunchuk/Nunchuk.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,17 +125,15 @@ static inline uint8_t nunchuk_decode_byte(uint8_t x) {
125125
*/
126126
static uint8_t nunchuk_read() {
127127

128+
I2C_START(NUNCHUK_ADDRESS);
129+
I2C_WRITE(0x00);
130+
I2C_STOP();
131+
128132
uint8_t i;
129133
Wire.requestFrom(NUNCHUK_ADDRESS, 6);
130134
for (i = 0; i < 6 && Wire.available(); i++) {
131135
nunchuk_data[i] = nunchuk_decode_byte(I2C_READ());
132136
}
133-
134-
// send new request
135-
I2C_START(NUNCHUK_ADDRESS);
136-
I2C_WRITE(0x00);
137-
I2C_STOP();
138-
139137
return i == 6;
140138
}
141139

0 commit comments

Comments
 (0)