Zanduino / MCP7940

Arduino Library to access the MCP7940M, MCP7940N and MCP7940x Real-Time chips
GNU General Public License v3.0
37 stars 22 forks source link

'BUFFER_LENGTH' was not declared in this scope #34

Closed LongmontRobotics closed 6 years ago

LongmontRobotics commented 6 years ago

In file included from C:\Users\Donald\Documents\Arduino\libraries\MCP7940\examples\SquareWave\SquareWave.ino:37:0:

C:\Users\Donald\Documents\Arduino\libraries\MCP7940\src/MCP7940.h: In member function 'uint8_t& MCP7940_Class::readRAM(uint8_t, T&)':

C:\Users\Donald\Documents\Arduino\libraries\MCP7940\src/MCP7940.h:238:17: error: 'BUFFER_LENGTH' was not declared in this scope

       if (i%BUFFER_LENGTH==0) {                                           // Read I2C again on buffer boundary//
SV-Zanshin commented 6 years ago

Which hardware are you using for this? I can't reproduce the problem for Uno/Micro/ATMega2560

SV-Zanshin commented 6 years ago

I just tried to compile for an ESP32 (which I happened to purchase this weekend) and get the compiler error you mentioned. Unfortunately when I fixed that error, I received an error regarding the interrupt handling, which is done differently on the ESP32 than with Atmel chips. I will fix this for the ESP32 but don't know if that is the microprocessor you are using.

LongmontRobotics commented 6 years ago

Yes, its an ESP32. Sorry for not mentioning it previously.

SV-Zanshin commented 6 years ago

I've uploaded a new version of the SquareWave.ino program which should fix the interrupt issue.