We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8b14763 commit a0d1772Copy full SHA for a0d1772
Wii-Nunchuk/Nunchuk.h
@@ -125,17 +125,15 @@ static inline uint8_t nunchuk_decode_byte(uint8_t x) {
125
*/
126
static uint8_t nunchuk_read() {
127
128
+ I2C_START(NUNCHUK_ADDRESS);
129
+ I2C_WRITE(0x00);
130
+ I2C_STOP();
131
+
132
uint8_t i;
133
Wire.requestFrom(NUNCHUK_ADDRESS, 6);
134
for (i = 0; i < 6 && Wire.available(); i++) {
135
nunchuk_data[i] = nunchuk_decode_byte(I2C_READ());
136
}
-
- // send new request
- I2C_START(NUNCHUK_ADDRESS);
- I2C_WRITE(0x00);
137
- I2C_STOP();
138
139
return i == 6;
140
141
0 commit comments