Hi, I was trying to use the Atmel Studio for compiling Arduino sketches but I keep getting this error,
pins_arduino.h: No such file or directory C:\Arduino\hardware\arduino\cores\arduino\Arduino.h 213 26 ArduinoCPP
I've setup the Toolchain to point to the Arduino 'Core', 'Standard' and SoftwareSerial libraries. I included the core.a library after building a sketch through the Arduino IDE. I setup the Symbols to include F_CPU=16000000L and ARDUINO=100. Under Misc I added -fno-exceptions.
Here is the .CPP code,
#include <avr/io.h>
#include <Arduino.h>
// digital pin 2 has a pushbutton attached to it. Give it a name:
int pushButton = 2;
// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
// make the pushbutton's pin an input:
pinMode(pushButton, INPUT);
}
// the loop routine runs over and over again forever:
void loop() {
Serial.println("Start of loop");
// read the input pin:
int buttonState = digitalRead(pushButton);
// print out the state of the button:
Serial.println(buttonState);
delay(1); // delay in between reads for stability
}
int main(void)
{
while(1)
{
setup();
loop();
}
}
What am I doing wrong here? Why am I getting this error?