If I #include <PrintEx.h> in the source file it says No such file or directory.
test.ino
#include "header1.h"
void setup()
{
}
void loop()
{
print_stuff();
}
header1.h
void print_stuff(void);
source1.cpp
#include <PrintEx.h>
#include <LiquidCrystal_I2C.h>
#include <Wire.h>
#include "header1.h"
/*-----( Declare objects )-----*/
// set the LCD address to 0x23 for a 16 chars 2 line display
// Set the pins on the I2C chip used for LCD connections:
// addr, en,rw,rs,d4,d5,d6,d7,bl,blpol
LiquidCrystal_I2C lcd(0x23, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Set the LCD I2C address
PrintEx myLCD = lcd;
void print_stuff(void)
{
lcd.begin(16,2);
float a=0.123456;
myLCD.printf("%.3f", a);
}
Returns:
Arduino: 1.6.5 (Windows 7), Board: "Arduino Nano, ATmega328"
C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++ -c -g -Os -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10605 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs C:\Users\Surreal\AppData\Local\Temp\build8485851296209560734.tmp\PrintEx_library_test.cpp -o C:\Users\Surreal\AppData\Local\Temp\build8485851296209560734.tmp\PrintEx_library_test.cpp.o
C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++ -c -g -Os -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10605 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino -IC:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs C:\Users\Surreal\AppData\Local\Temp\build8485851296209560734.tmp\source1.cpp -o C:\Users\Surreal\AppData\Local\Temp\build8485851296209560734.tmp\source1.cpp.o
C:\Users\Surreal\AppData\Local\Temp\build8485851296209560734.tmp\source1.cpp:1:21: fatal error: PrintEx.h: No such file or directory
#include <PrintEx.h>
^
compilation terminated.
Error compiling.
But if I put everything in the ino file it works.
What am I doing wrong?