I am creating a small device based on a Nano that has a 4x4 matrix keypad as an input and a few i2C devices as peripherals.
- OLED display 64x128 SSD1306 @address 0x3C
- EEPROM memory @address 0x50
- RTC @address 0x68
The code looks for keypress inputs and when a valid 6-digit number is entered, it is written to the EEPROM @ 0x50 with a date and time from the RTC.
All of my code works individually in test functions (examples, etc.) and complies, loads and runs on my circuit until I add one specific function that is based on the i2C scanner example. As soon as I include this function, my code will compile and load without error but freezes my device and nothing runs.
The function that causes error is called I2C_Test() and is called by Key_A_Pressed() (or KEY_B, C ) line 5. Currently the function is commented out and the code compiles and runs perfectly showing all of the relevant info on the display with relevant keypad inputs but as soon as I uncomment the code nothing works.
Initially, I thought that I might be using too much program storage space but I am only at 62% according to the compiler. The i2C function I am adding is not using any new or special libraries that are not already in use so I am lost as to why I cannot get it to run…
I have attached a zip folder containing the full code and all the functions in additional tabs.
Any help would be greatly appreciated.
Thanks in advance!
EEPROM_programmer_V01_230120.zip (8.13 KB)