Pages: [1]   Go Down
Author Topic: arduino-0018 from linux command-line  (Read 390 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So, I threw arduino-0018 on my linux box to develop from there instead.
I looked around and found details as to how to get it to work from the command line, mainly editing the makefile and getting the board to reset before uploading.. got it working.
An empty sketch works.  Heck, even a sketch that's not empty works.
But, for some reason, if I use certain functions (in this case, attachInterrupt()), I get an error.

Code:
void setup() {
  Serial.begin(9600);
  pinMode(2, INPUT);
  pinMode(3, INPUT);

  digitalWrite(2, HIGH);
  digitalWrite(3, HIGH);

  attachInterrupt(0, pinChange2, CHANGE);
  attachInterrupt(1, pinChange3, CHANGE);
}

And when I try to compile it... (yes there's a loop() function in there as well)

Code:
ashley@shuttle:~/foo$ make
/usr/bin/avr-gcc -mmcu=atmega328p -I. -gstabs -DF_CPU=16000000 -I/home/ashley/arduino-0018/hardware/arduino/cores/arduino -Os -Wall -std=gnu99  -o applet/foo.elf applet/foo.cpp -L. applet/core.a -lm
cc1plus: warning: command line option "-std=gnu99" is valid for C/ObjC but not for C++
/tmp/ccauvGtv.o: In function `setup':
applet/foo.cpp:18: undefined reference to `attachInterrupt'
applet/foo.cpp:19: undefined reference to `attachInterrupt'
make: *** [applet/foo.elf] Error 1
ashley@shuttle:~/foo$

I grep'd on the folder with the header files -
Code:
ashley@shuttle:~/arduino-0018/hardware/arduino/cores/arduino$ grep attach *
WInterrupts.c:void attachInterrupt(uint8_t interruptNum, void (*userFunc)(void), int mode) {
WInterrupts.c:void attachInterruptTwi(void (*userFunc)(void) ) {
wiring.h:void attachInterrupt(uint8_t, void (*)(void), int mode);
ashley@shuttle:~/arduino-0018/hardware/arduino/cores/arduino$

So I'm stumped.  It must be indexing the header files properly if SOME stuff works, such as Serial.begin(9600).. but not wiring.h?  Confusion ensues.  Help?
Logged

Pages: [1]   Go Up
Jump to: