pixelmatix / aurora

Aurora runs on SmartMatrix, a beautiful music visualizer, dynamic art display, video game art display.
http://kck.st/1RUlTfb
Other
162 stars 44 forks source link

Can't compile source, aJSON.h not found #5

Closed kigster closed 9 years ago

kigster commented 9 years ago

I was able to successfully upload the Aurora.hex file, but I can not compile the sources. I tried both my default environment (Eclipse with Arduino plugin and Teensy support), as well as in plain Arduino 1.0.6. Both give the same error. The file aJSON.h is not present anywhere in my library folder, nor in the Arduino installation folder.

Halp? :)

/Applications/Arduino 1.0.6.app/Contents/Resources/Java/hardware/tools/arm-none-eabi/bin/arm-none-eabi-g++ 
-c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections 
-mcpu=cortex-m4 -DF_CPU=72000000 -MMD -DUSB_VID=null 
-DUSB_PID=null -DARDUINO=106 -mthumb -nostdlib -D__MK20DX256__ 
-DTEENSYDUINO=120 -fno-rtti -felide-constructors -std=gnu++0x -DUSB_SERIAL 
-DLAYOUT_US_ENGLISH -I/Applications/Arduino 
1.0.6.app/Contents/Resources/Java/hardware/teensy/cores/teensy3 
-I/Users/kig/arduino/sketches/libraries/SmartMatrix 
-I/Applications/Arduino 1.0.6.app/Contents/Resources/Java/libraries/FastLED 
-I/Applications/Arduino 1.0.6.app/Contents/Resources/Java/libraries/RobotIRremote 
-I/Applications/Arduino 1.0.6.app/Contents/Resources/Java/libraries/SPI 
-I/Applications/Arduino 1.0.6.app/Contents/Resources/Java/libraries/SD 
-I/Applications/Arduino 1.0.6.app/Contents/Resources/Java/libraries/Wire 
-I/Applications/Arduino 1.0.6.app/Contents/Resources/Java/libraries/Time 
-I/Applications/Arduino 1.0.6.app/Contents/Resources/Java/libraries/DS1307RTC 
/var/folders/1v/84fnd63d37sg6gp3l2q332sw0000gn/T/build8235374738166652215.tmp/Aurora.cpp 
-o /var/folders/1v/84fnd63d37sg6gp3l2q332sw0000gn/T/build8235374738166652215.tmp/Aurora.cpp.o 
Aurora.ino:56:19: fatal error: aJSON.h: No such file or directory
compilation terminated.
kigster commented 9 years ago

I found this library: https://github.com/interactive-matter/aJson and installed it, but I am still unable to compile. Getting lots of errors everywhere.

I see that this project was built with Visual Studio. Has anyone tried building it with just plain Arduino IDE?

I replaced FastLED library with the latest HEAD from github. Is that good?

Other issues: file bitmans.h is missing #ifndef Bitmap_h

Would love to be able to build this. The project looks amazing, and the code is easy to follow.

jasoncoon commented 9 years ago

Hey, sorry for the trouble, I'll investigate. I assume you're working from the master branch?

I do use Visual Studio, but it should still work with the Arduino IDE. I haven't tested that in a while.

jasoncoon commented 9 years ago

OK, I'm able to compile the master branch without error here. Looks like you might just need to download the aJSON library, you can get it here: https://github.com/interactive-matter/aJson Make sure you download the zip containing the latest code from the main page, not from the releases which are out of date. The full instructions for compiling, with all of the required libraries listed, are in the wiki here: https://github.com/pixelmatix/aurora/wiki/Compiling

Please let me know if that doesn't work, or if you have any other problems or questions.

kigster commented 9 years ago

Thanks – compiling link is useful!

I was able to build using Arduino IDE 1.0.6, so that's great.

Now, my main environment is Eclipse C/C++ with Arduino/Teensy support, and there I am having troubles building there. The most common issue is when it's compiling a header file that references a global variable defined in the *.ino file, it's not getting resolved, for example:

In file included from ../.ino.cpp:17:0:
../IrCodes.h: In function 'long unsigned int decodeIRCode()':
../IrCodes.h:95:9: error: 'irReceiver' was not declared in this scope

I think the problem is that ../.ino.cpp file that's generated includes *.ino file at the very bottom. This is how it looks:

//This is a automatic generated file
//Please do not modify this file
//If you touch this file your change will be overwritten during the next build
//This file has been generated on 2014-12-13 14:07:43

#include "Arduino.h"
#include "Hardware.h"
#include <SmartMatrix.h>
#include <FastLED.h>
#include <IRremote.h>
#include <SPI.h>
#include <SD.h>
#include <Wire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include "aJSON.h"
#include "IrCodes.h"
#include "Effects.h"
#include "GifPlayer.h"
#include "BitmapPlayer.h"
#include "MessagePlayer.h"
#include "Logo.h"
#include "Drawable.h"
#include "Playlist.h"
#include "Runnable.h"
#include "ClockDigitalShort.h"
#include "ClockDisplay.h"
#include "Patterns.h"
#include "Animations.h"
#include "Bitmaps.h"
#include "MenuItem.h"
#include "Menu.h"
#include "Settings.h"
#include "SettingsSetTime.h"
#include "SettingsMoveClock.h"
void setup() ;
void loop() ;
void powerOff() ;
void loadSettings() ;
int getBrightnessLevel() ;
int getBackgroundBrightnessLevel() ;
void adjustBrightness(int delta) ;
uint8_t cycleBrightness() ;
void adjustBackgroundBrightness(int d) ;
void boundBrightness() ;
void boundBackgroundBrightness() ;
void saveBrightnessSetting() ;
void saveBackgroundBrightnessSetting() ;
int loadIntSetting(char* dir, const char* settingPath, int maxLength, int defaultValue) ;
void saveIntSetting(char* dir, const char* settingPath, int value) ;

#include "Aurora.ino"

Do you have any clue how Arduino IDE solves this?

jasoncoon commented 9 years ago

Sorry, I've only ever used Arduino and Visual Studio (with the Visual Micro plugin). I'll try to test with Eclipse and see if I can help.

kigster commented 9 years ago

Don't worry, I have been using Eclipse to edit, and Arduino 1.0.6 to compile :) I think that 1.0.6 version used a different method compared to 1.5.8 (which is what Eclipse uses). So I think it's more to do with Arduino version, than Eclipse itself.

kigster commented 9 years ago

And by the way, thank you for open sourcing phenomenal visuals! I played them at a party this weekend, and it was a huge hit (just the patterns on autoplay, no SD card, or any animations).

jasoncoon commented 9 years ago

Glad you were able to work around it. No problem, most of the patterns are either ported from other open source projects or were inspired by the work of others, so I'm glad to share them. Glad to hear they're appreciated. :)

kigster commented 9 years ago

As a side note I open sourced a sleek laser-cut enclosure for 32x32 5mm LED matrix here: https://github.com/kigster/omnipix/tree/master/enclosure

You can see it live here: http://kiguino.moos.io/images/omnipix-enclosure.jpg

embedded-creations commented 9 years ago

@kigster Can you share your enclosure with the SmartMatrix Community? http://pixl.mx/SmartMatrixUsers I think people browsing there would be interested

kigster commented 9 years ago

Done!

jasoncoon commented 9 years ago

Thanks!