It's my first Atmel Studio project. I've set up the IDE and made it work with example code provided with new project.
Now I'm trying to run a simple code using PCF8574:
#include <Arduino.h>
#include <Wire.h>
#include <PCF8574.h>
/* Constants */
const int static SERIAL_SPEED = 57600;
/* Functions */
void setup();
void loop();
/* Variables */
PCF8574 expander = PCF8574();
void setup() {
Serial.begin(57600);
expander.begin(0x20);
}
void loop() {
expander.digitalWrite(1, HIGH);
delay(1000);
expander.digitalWrite(1, LOW);
delay(1000);
}
but I keep getting these errors:
undefined reference to 'PCF8574::begin(unsigned char)'
undefined reference to 'PCF8574::digitalWrite(unsigned char, unsigned char)'
undefined reference to 'PCF8574::PCF8574()'
I've added PCF8574 to compiler directory (Properties > Toolchain > AVR C++ Compiler > Directories) and I'm sure that compiler 'sees' the .h file - otherwise it would throw 'No such file or directory' error.
PCF8574 library code: http://nettigo.pl/attachments/196
The same code (copied and pasted) compiled on ArduinoIDE works just fine so I gues it's something wrong with compiler/linker settings.
Has anyone encountered similar problem? I don't know what else do I save to setup in IDE to make it work fine.