Uncategorized
donbindner
—
2015-08-26T13:45:52Z —
#1
I'm trying to set up my Arduino environment. I run Ubuntu and the stock Arduino is old, so I uninstalled the packages and grabbed version 1.6.5 from arduino.cc (for 32 bit Linux).
I followed the instructions for adding "Additional Boards Manage URLs" under File/Preferences, and then used the Boards Manager under Tools/Boards to install the Tsunami support.
When I select the Tsunami board and try to compile the simple 440hz program, I get this error:
Arduino: 1.6.5 (Linux), Board: "Arachnid Labs Tsunami"
/usr/local/arduino-1.6.5/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=10605 -DARDUINO_AVR_TSUNAMI -DARDUINO_ARCH_AVR -DUSB_VID=0x1209 -DUSB_PID=0x1AB5 -DUSB_MANUFACTURER="Arachnid Labs" -DUSB_PRODUCT="Tsunami" -I/usr/local/arduino-1.6.5/hardware/arduino/avr/cores/arduino -I/home/dbindner/.arduino15/packages/arachnidlabs/hardware/avr/1.0.0/variants/tsunami /tmp/build2478014283014091301.tmp/_440hz.cpp -o /tmp/build2478014283014091301.tmp/_440hz.cpp.o
_440hz.ino: In function 'void setup()':
_440hz.ino:3:5: error: 'Tsunami' was not declared in this scope
_440hz.ino: In function 'void loop()':
_440hz.ino:7:5: error: 'Tsunami' was not declared in this scope
'Tsunami' was not declared in this scope
My code looks like this:
void setup() {
// Initialize the Tsunami
Tsunami.begin();
}
void loop() {
Tsunami.setFrequency(440.0);
}
What I don't see anywhere in /home/dbindner/.arduino15/packages/arachnidlabs/hardware/avr/1.0.0/variants/tsunami is tsunami.h or Tsunami.h (which of course would be different on a Linux system). But I don't know the internals of the Arduino environment well....
I can fix the Tsunami errors by copying the contents of the src/ folder from the Tsunami github project. But I still get an error on SPI.h. Is this a dependency not made clear? How do I install the SPI library?
donbindner
—
2015-08-26T13:54:19Z —
#2
To reply to my own thread, I can get it to work if I copy those files and also add at the top of my code:
#include <tsunami.h>
I can get it to compile if I also make a symbolic link to SPI.h from /usr/local/arduino-1.6.5/hardware/arduino/avr/libraries/SPI/SPI.h
Then it fails to link. It doesn't have the SPI object code.
So all of the include directories and library directories must be specified somewhere I suppose?
donbindner
—
2015-08-26T14:51:01Z —
#3
To reply again; I figured out my problem. It came down to 2 misunderstandings.
I missed the step in the installation instructions where the Tsunami libraries are installed. Going back through https://github.com/arachnidlabs/tsunami-arduino/wiki/Installation helped me get that right.
-
I interpreted the example code as literally correct/exact. My example code that compiles and links successfully requires two extra #include statements.
#include <SPI.h>
#include <tsunami.h>
void setup() {
// Initialize the Tsunami
Tsunami.begin();
}
void loop() {
Tsunami.setFrequency(440.0);
}
I haven't tried to upload this to my Tsunami, but I feel confident that I finally have it right.
nickjohnson
—
2015-08-29T13:54:19Z —
#4
Sorry about all the trouble, especially the header files. Which examples were you looking at for these that were missing the includes?
-Nick
donbindner
—
2015-08-29T14:35:43Z —
#5
Well, I went pretty much straight to the first example listed in the right-side tab of pages, because I was excited to see it work:
https://github.com/arachnidlabs/tsunami-arduino/wiki/Basic-Signal-Generation
I had missed the step about the libraries here:
https://github.com/arachnidlabs/tsunami-arduino/wiki/Installation#installing-the-tsunami-libraries
I probably missed that because there's no screen shot, and right below it is the Microsoft Windows section, which didn't apply to me. I was reading sort of quickly.
I eventually found the Getting Started page under Home. I didn't think to look inside the Home link at first, because usually that's just like the "top page" of a project.
On a sort of related note: For the future, it might be good to have some kind of slip of paper in the package with a link to the documentation, since I found it off-putting to have no directions.
Nantonos
—
2015-08-31T11:20:23Z —
#6
Yes! I already knew about and had used the forum, but new users will not know that.