3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Synchronizing Fireflies

Step 6Software

I will not go into details on how to actually program a microcontroller, there are better pages to learn how to do that. See http://www.instructables.com/id/E5H5UDWB5UEUKIKV8V/

The complete program fits into 552 bytes, that makes only 276 instructions on Assembler level. That is pretty nothing, as there is still some startup and configuration code within it. And it consumes only 54.5% of the flash memory so you can still add more features to that.

I bet the core algorithm can be implemented in less than 100 bytes.
Someone?

The steps the program executes are:

1. blink 5 times (say hello)2. compute the average brightness and store it3. power = power + 14. if brightness >= daylight (is it daylight?)    * sleep some seconds5. if brightness > average brightness (that was a flash)    * power = power + 1006. if power > MAX    * flash    * power = 0 7. goto 3

Actually this is a bit simplified but you get the idea.

Upload the program and start the fireflies. If everything is ok, they should be able to synchronize in about a minute or two.

I had some problems in getting the fireflies synchronized. As they are running on their internal oscillator, they all have different speeds. I thought it would help to recallibrate them by changing the delay loop of every chip. My girlfriend asked, what I was doing and I told her. She thought, that that is like cheating. Fireflies are not callibrated either. What should I say? She was right. So I decided not to do it and searched for another solution. Keep in mind to go for the easiest solution that could possibly work.
« Previous StepDownload PDFView All StepsNext Step »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
45
Followers
4
Author:alex_weber