Step 6Software
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 Step | Download PDFView All Steps | Next Step » |
![]() |
Add Comment
|












































