I am interfacing a device that only functions at 32khz, so I have changed my twi.h file to have:
/*** twi.h ***/ #ifndef TWI_FREQ #define TWI_FREQ 32000L //changed from 100000L #endif
My sketch functions perfectly, but I would like to change the twi header back to it’s original value (100000L). This is important so that I can distribute the code for use with unmodified headers. So I have tried writing:
/*** Spork's I2C sketch ***/ #define TWI_FREQ 32000L #include <Wire.h>
With the idea that the ifndef would let my value stay at 32000, but my communication fails when it is set this way, so I suspect that it’s still running at 100000. Is there any way to fix this without editing the header file?
(Running arduino version 0017)