Memorial day is 05/25/2015 – Orders will ship out on May 26th. There will not be any deliveries or shipping on Monday. Any order placed after 11am ET on Friday May 22nd will not start to ship out until Tuesday May 26th.

Having issues with Arduino/Adafruit sketch
Moderators: adafruit_support_bill, adafruit

Having issues with Arduino/Adafruit sketch

by LizQuilty on Sun May 26, 2013 2:57 am

I have been through the documents, forums and other posts everywhere but am unable to get this to work

The sketch i was using to test was the code from http://learn.adafruit.com/sparkle-skirt/code (since im using similar items).

I have installed the library Adafruit_LSM303DLHC , however when i verify the sketch it says im missing Adafruit_Sensor.h which it appears to include.

So from there i installed the Adafruit_Sensor from https://github.com/adafruit/Adafruit_Sensor - however this did not work or detect for some reason. I copied the .h files etc into the Adafruit_LSM303DLHC library which allowed it to be used, however now im getting the error

Code: Select all | TOGGLE FULL SIZE
motionled.ino:13:1: error: ‘Adafruit_LSM303’ does not name a type
motionled.ino: In function ‘void setup()’:
motionled.ino:34:8: error: ‘lsm’ was not declared in this scope
motionled.ino: In function ‘void loop()’:
motionled.ino:46:3: error: ‘lsm’ was not declared in this scope


Can anyone tell me why the Adafruit_Sensor was not detected/used prior to putting it in the other dirs ? It has no - or other odd characters, the only difference i could see was no examples dir.

Secondly, does anyone know why the sketch is not working for that? is this related to the Adafruit_Sensors problems?
Last edited by LizQuilty on Sun May 26, 2013 3:55 am, edited 1 time in total.
User avatar
LizQuilty
 
Posts: 9
Joined: Sun May 26, 2013 2:49 am

Re: Having issues with Arduino/Adafruit Libraries

by LizQuilty on Sun May 26, 2013 3:02 am

Hmm ok, i lie, if i add

#include <Adafruit_Sensor.h>


near the top of the sketch, it is working ok, its only when being included by the library Adafruit_LSM303DLHC it was failing to load. So put that back into its own dir and that is working.

Still getting the previous error though

motionled.ino:14:1: error: ‘Adafruit_LSM303’ does not name a type
motionled.ino: In function ‘void setup()’:
motionled.ino:35:8: error: ‘lsm’ was not declared in this scope
motionled.ino: In function ‘void loop()’:
motionled.ino:47:3: error: ‘lsm’ was not declared in this scope
User avatar
LizQuilty
 
Posts: 9
Joined: Sun May 26, 2013 2:49 am

Re: Having issues with Arduino/Adafruit sketch

by adafruit_support_bill on Sun May 26, 2013 6:10 am

motionled.ino:14:1: error: ‘Adafruit_LSM303’ does not name a type

It is not finding your LSM303 library. Make sure it is installed in the right place: http://learn.adafruit.com/adafruit-all- ... -a-library

adafruit_support_bill
 
Posts: 37483
Joined: Sat Feb 07, 2009 10:11 am

Re: Having issues with Arduino/Adafruit sketch

by LizQuilty on Sun May 26, 2013 6:21 am

I have the Adafruit_LSM303DLHC library installed and that appears to be working ok. Do i need both installed? (I thought only one could be installed at a time from another thread i read)
User avatar
LizQuilty
 
Posts: 9
Joined: Sun May 26, 2013 2:49 am

Re: Having issues with Arduino/Adafruit sketch

by LizQuilty on Sun May 26, 2013 6:29 am

ok removed the other one and put the new one in - now it compiles - hooray! thanks! On to the next problem (which i suspect is wiring)
User avatar
LizQuilty
 
Posts: 9
Joined: Sun May 26, 2013 2:49 am