Pages: 1 [2] 3   Go Down
Author Topic: Lilypad on the move  (Read 2143 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 35
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

able to note/ record the number of swing u made n save it in the lilyboard
Logged

New York
Offline Offline
Edison Member
*
Karma: 1
Posts: 1023
E != m*c^2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That was not part of my code, but it could be done. You should start out from the basics tho, get the lilypad to read data from the accelerometer... as for my code, it seems I have deleted it accidentally a while back.

Use the example code for the accelerometer (I referred to it in a previous post), and change it up for your setup (e.g.: the pins you use)

Did you ever get a program to upload btw? That was kind of an important problem to get resolved.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 35
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yup.. i got the blink uploaded... Now the Lilypad will blink but when i plug in it will also blink so it doesn't make a different but this time i am able to see Done Uploading frond the Program.

Use the example code for the accelerometer ? - does it means i Program it in the lilypad but for the accelerometer?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 35
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

O ya! 1 very important question if i were to use the conductive thread to combine the accelerometer and the lily pad up do i need to follow a protocol to do it as i see the lilypad has number indicated at each of the tiny holes..
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 610
Posts: 49077
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The acceleometer needs to be connected to +5V, Gnd, and 3 analog pins.

Whichever pins you connect it too, those are the ones you program the lilypad to read from.
Logged

New York
Offline Offline
Edison Member
*
Karma: 1
Posts: 1023
E != m*c^2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Not to sound, er, mean, I guess, but perhaps you should try a normal arduino out first. It seems your missing a lot of basics, which you will need, even for a project as seemingly simple as yours. I would get an arduino 2009 (Duelmilanova, i think, but that is probably spelled wrong), along with an accelerometer, and use that to "prototype" your idea... A starter kit would be even better, because that would give you a good intro to much more than just one specific thing you can do with the arduino:

http://www.adafruit.com/index.php?main_page=product_info&cPath=17&products_id=68

^there are a number of such starter kits, but I like this one, because it comes with nice instructions... it does not, however, include an accelerometer, but you can always pick one up at sparkfun.com  
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 35
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Jezuz and pauls!

I will try out with the basic and try to catch up asap as my project is during 3 weeks.. haha!!

Pace in my school is OMG!

Nevertheless, i really appreciate the help u all render.. Tomorrow shall read up and seek for the Starter kit~ Hope to catch up!

But On top of that I would like to as k a Quick one hope u all can advice me! Lets say i would like to combine the Tri LED and the Accelerometer and there is a Default in source for Tri Led , I must put in it in the and start another New Void() paragraph?  :-/  
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 610
Posts: 49077
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Lets say i would like to combine the Tri LED and the Accelerometer and there is a Default in source for Tri Led , I must put in it in the and start another New Void() paragraph?

There is a lot in that question that I do not understand. But, no, you do not start a new function to deal with the LED. There can be only one setup() and one loop() function.

Within the setup() function, you can have code to set up more than one sensor. Within the loop() function, you can read more than one sensor's output, and control more than one output device.

Care needs to be taken that you do not block in the loop method, waiting for a button press, for instance, ignoring all the other sensors outputting data.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 35
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

haha.. so sorry a lot of typo!

Oh i see so All the instruction programming should be in the loop ..

[td]Care needs to be taken that you do not block in the loop method, waiting for a button press, for instance, ignoring all the other sensors outputting data.[/td]

u mean at any time only 1 sensor is only allow to work?
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 610
Posts: 49077
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
u mean at any time only 1 sensor is only allow to work?

No. All the sensors work, all the time, regardless of whether the Arduino is paying attention to them, or not.

But, suppose you had a clock chip. It's happily keeping track of the time. You have an LCD, too. It's displaying the time. You have a couple of buttons. You want to make a stopwatch. You set one button as the start button, and another as a stop button.

When the start button is pushed, the Arduino should start displaying the elapsed time on the LCD, instead of the current time, and should start looking for the stop button to be pressed.

Now, it's important to get that stop button press when it happens, not 10 minutes later.

So, you might be tempted to implement a while loop, to wait for that button press event. That becomes a blocking activity though, in that nothing else can happen until the button is pressed. The LCD can't be updated. No other sensor changes matter. Generally, that is not a good thing.

This situation is why interrupts were developed.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 35
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

O ok.. Understood..

I bought the Conductive thread to connect all the different device together.. Does it make a different to how many rounds i made and the + and - will be flooded with alot of sensor connecting to it.. Is it ok?
Logged

New York
Offline Offline
Edison Member
*
Karma: 1
Posts: 1023
E != m*c^2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How many is a lot? There is only so much current you can pull from those pins (400mA or so, from what I recall).

As for the "looping" - make as many as you need to make sure the string is well connected, but in the sense that it won't easily fall off, and in the sense that it makes a good connection with the pad (you should test your threads with a multimeter for continuity)
« Last Edit: December 15, 2009, 12:02:44 am by jezuz » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 35
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i have 3 component ( the lily buzzer; the tri LEd and the accelerometer)
i will be using the Lipower as Battery source So 4 component to the + and -
Logged

New York
Offline Offline
Edison Member
*
Karma: 1
Posts: 1023
E != m*c^2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That should work, let me know how well the lipower works, I am using the AAA adapter in my project and it dies WAY to quickly... within 10 minutes of straight use.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 35
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ok Haha i bought that too! haha but decided to use the Lipower but kinda stupid i never purchase the charger... Will defiantly tell u how well it works...
Logged

Pages: 1 [2] 3   Go Up
Jump to: