Lilypad Project


This is my first time using a microprocessor. I wanted to use the LilyPad with buzzer, led, and accelerometer for a project. My goal is to have it in a hanging toy, and if the toy has been moved or tilted then the buzzer will play music and the led would go off. Anyone able to assist? Greatly appreciate. Similar to this project here, . Thank you!

You need to select an accelerometer . There are analog and digital types.

Yes I have the lily pad accelerometer

You haven't told us anything. You are supposed to give us a SITREP (situation report) explaining what progress you have made, what datasheets you have read, what tutorials you have read, what you know about how to use the hardware you have. So far you have given us nothing. There are plenty of tutorials out there but you have not referenced them not acknowledged their existence. Are we to understand that you have googled nothing and read nothing so far ? Please post a SITREP so we know what we are dealing with.

Please don't be rude about my inquiry, I am just looking for some guidance and assistance.

I have all the parts needed, I know how to use basic functions of the lilypad and have gotten only the blinking function working. I have not been able to correctly get the accelerometer, or buzzer working with the lilypad in a sequence. I have all the power supplies and conductive thread so that I can sew this into a fabric.

I am trying to replicate this action shown in the video. Except, with the individual components and some assistance in the coding for the lilypad.

I have only been able to have the LED's blink in sequence.

I wasn't rude. I simply asked for a SITREP so we know where to start. If I was going to be rude I would ask you to read the sticky on how to use this forum.,148850.0.html

which is the equivilent of reading you the riot act. I didn't do that. We need to know where you are so we can figure out what you need. You don't need to be sensitive. 90% of what we do is tell people what they need to do. I don't know why you consider that rude. If you get a small speaker or Piezo element you can use the ToneAC library or ToneAC 1.2 (upgraded version),142097.0.html

Since you didn't include any mention of what exactly you have done in an attempt to get the acelerometer working, (that's what the SITREP was supposed to cover) , this is the part where I ask you if you have gone through this tutorial :

Specifically, have you looked at this code ?

 * LilyPad example project
 * Uses an accelerometer to control the
 * color of an RGB LED

int sensorValue;                   //variable to hold accelerometer data
int accelero = 5;                  //analogue pin that acclerometer is tied to

void setup() {
  Serial.begin(9600);               //initialize the serial port so that you can communicate with the computer
  initializeRGB();                  //initialize the RGB LED pins and color (see RGB_lib)
  setGradient(230,320,390);         //set gradient (see RGB_lib)
                                    // 1st number is the lowest value you get from your sensor
                                    // 2nd is approximate midpoint
                                    // 3rd is highest value you get from your sensor

void loop() {
  sensorValue = analogRead(accelero);        // read accelereometer data
  //Serial.println(sensorValue);               // send the sensor data to the computer so you can calibrate RGB LED display
  //delay(100);                                // delay so computer can display data
                                             // NOTE: remove the delay for your final version
                                             // once you've figured out what your gradient values are
                                             // this will make your color transitions nice & smooth
  simpleColor(sensorValue);                  // display sensor value in the RGB LED (see RGB_lib)

1- Have you read the tutorial 2- Have you read the datasheet

3- Have you seen the Sparkfun page on the Lillypad Acelerometer ? 4- Do you know how to access the x, y, & z outputs of the ADXL335 ?

What ? No comment ? I'm the only one that replied to your post. You could at least acknowledge that you saw my last post.

I just saw this sorry, this is a good reference. I am not using a piezo speaker, just the buzzer that is in the lilypad line.

I will try to put these together to see if I can get them connected and communicating. Thank you.