Next was a matter of creating an extremely basic test bed to work out the effects of the lighting and flicker rates. Below, you can see the project running off of USB power from a shut down (but plugged in) ASUS EEEpc (it is possible to run Arduino's IDE on an EEEpc - but that's another story for another time).
Now comes designing a suitable prototype - one that will be as close to the finished product as possible - testing all the different features you'll want in terms of looks and function, letting you work out what materials and components are most suitable. Of course you'll want to keep your Arduino for other prototyping projects and experiments (they're cheap, but not that cheap) - and plus, it's way too big to fit inside the average coconut. So is there a way around this?
Yes - it turns out you can "skrinkify" your Arduino projects. Make Magazine did a video and article where they explained how to use an Arduino and its development environment to program an ATtiny45 or 85 chip - this was based on an MIT tutorial.
I have some AT's I picked up from Bangkok's Chinatown, but I haven't gotten around to seeing if this particular project I'm working on will translate into this solution. When I do, I will post "Part 2." If it does work, I will go ahead and build the above SketchUp model of the coconut lantern. There's going to be some issues, and I will share what they are and how I worked around them in the next post.
Review :: So here's my workflow - 1. come up with a concept, find reference projects to help you with code for the Arduino. 2. Build a basic, bare-bones test bed to test the code (be patient, this can be difficult, especially if you are like me and not great at programming). 3. Design your prototype - make it as close as possible to the final version. 4. Test your components + materials for the final prototype. 5. Build the prototype.
Thanks for reading! Contact us if you've got any questions.
* Here is the code I used with the SparkFun Circuit02 setup:
// LED Fire Effect
int ledPin1 = 6;
int ledPin2 = 7;
int ledPin3 = 8;
int ledPin4 = 9;
int ledPin5 = 2;
int ledPin6 = 3;
int ledPin7 = 4;
int ledPin8 = 5;
void setup()
{
pinMode(ledPin1, OUTPUT);
pinMode(ledPin2, OUTPUT);
pinMode(ledPin3, OUTPUT);
}
void loop() {
analogWrite(ledPin1, random(120)+135);
analogWrite(ledPin2, random(120)+135);
analogWrite(ledPin3, random(120)+135);
analogWrite(ledPin4, random(120)+135);
analogWrite(ledPin5, random(120)+135);
analogWrite(ledPin6, random(120)+135);
analogWrite(ledPin7, random(120)+135);
analogWrite(ledPin8, random(120)+135);
delay(random(100));
}