I grabbed some code off GitHub and created a new project. I copied a couple of .h files and a .cpp file that the .ino file uses into the directory. One of the .h files has a #include for <Adafruit_MCP23017.h> which is a version local to the GitHub directory. I wanted to try this with the "standard" version, so I changed the name. Here's the start of the file after my edit:
/*
* RotaryEncOverMCP.h
*
* Created on: 21.05.2018
* Author: Maxi
*/
#ifndef SRC_ROTARYENCOVERMCP_H_
#define SRC_ROTARYENCOVERMCP_H_
/* Describes new objects based on the Rotary and Adafruit MCP23017 library */
#include <Adafruit_MCP23X17.h>
#include <Rotary.h>
When I try to compile the project, I get the following:
In file included from C:\Users\Elby\Documents\Arduino\code\Interrupt_ESP32_Separate_Task\Interrupt_ESP32_Separate_Task.ino:5:
RotaryEncOverMCP.h:12:10: fatal error: Adafruit_MCP23017.h: No such file or directory
#include <Adafruit_MCP23017.h>
^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1
Adafruit_MCP23017.h: No such file or directory
It seems the system has not registered my textual change. I've tried re-starting the IDE, and double-checked in a text editor that the change from 23017 to 23x17 is in place - it is. Can anyone tell me what's going on here? Thanks.
Did you actually "install" the newer library first before trying to use it or just make the name change in the source file and attempt to recompile? If you didn't install it first, it could cause a problem.
I have it previously installed, and have been using it for quite a while. That's why I didn't want to use the version (called MCP23017.h) that was available in the GitHub distribution.
I'm going to ask you to post the full verbose output from a compilation.
This procedure is not intended to solve the problem. The purpose is to gather more information.
Please do this:
Open your sketch in Arduino IDE.
Select File > Preferences... from the Arduino IDE menus.
The "Preferences" dialog will open.
Check the box next to "Show verbose output during: โ compilation" in the "Preferences" dialog.
Click the OK button.
Select Sketch > Verify/Compile from the Arduino IDE menus.
After the compilation fails you'll see a button on the right side of the orange bar in Arduino IDE: Copy error messages. Click that button.
This copies the full output to the clipboard.
Open a forum reply here by clicking the Reply button.
Click the <CODE/> icon on the post composer toolbar.
This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
Press Ctrl+V.
This will paste the compilation output into the code block.
Move the cursor outside of the code tags before you add any additional text to your reply.
Click the Reply button to post the output.
In case the output is longer than the forum software will allow to be added to a post, you can instead save it to a .txt file and then attach that file to a reply here:
Open a forum reply here by clicking the Reply button.
Click the "Upload" icon () on the post composer toolbar:
A dialog will open.
In the dialog, select the .txt file you saved.
Click the Open button.
Click the Reply button to publish the post.
Alternatively, instead of using the "Upload" icon on the post composer toolbar as described in steps (5) - (7) above, you can simply drag and drop the .txt file onto the post composer field to attach it.