Having issues with Arduino/Adafruit sketch

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
lizquilty
 
Posts: 9
Joined: Sun May 26, 2013 2:49 am

Having issues with Arduino/Adafruit sketch

Post by lizquilty »

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

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

Post by lizquilty »

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
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Having issues with Arduino/Adafruit sketch

Post by adafruit_support_bill »

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

User avatar
lizquilty
 
Posts: 9
Joined: Sun May 26, 2013 2:49 am

Re: Having issues with Arduino/Adafruit sketch

Post by lizquilty »

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

Post by lizquilty »

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)

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”