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 75e3d90 commit 613d0b7Copy full SHA for 613d0b7
Wii-Nunchuk/Nunchuk.h
@@ -40,14 +40,6 @@
40
#define I2C_START(x) Wire.beginTransmission(x)
41
#define I2C_STOP() Wire.endTransmission()
42
43
-#ifndef CPU_FREQ
44
-#define CPU_FREQ 16000000L
45
-#endif
46
-
47
-#ifndef TWI_FREQ
48
-#define TWI_FREQ 400000L
49
50
51
uint8_t nunchuk_data[6];
52
uint8_t nunchuk_cali[16];
53
@@ -72,7 +64,7 @@ static void nunchuk_init() {
72
64
73
65
// Change TWI speed for nuchuk, which uses Fast-TWI (400kHz)
74
66
// Normally this will be set in twi_init(), but this hack works without modifying the original source
75
- TWBR = ((CPU_FREQ / TWI_FREQ) - 16) / 2;
67
+ Wire.setClock(400000);
76
68
77
69
#ifdef NUNCHUK_DISABLE_ENCRYPTION
78
70
I2C_START(NUNCHUK_ADDRESS);
0 commit comments