Unfortunately, I couldn't buy my own arduino kit yet. So I borrowed one and practiced digital input/output. After basic experiment, I tested LED blinking deeply. How fast blinking we can recognize blinking?
When I use a float variable, Arduino said, "Sketch too big; try deleting code, removing floats, or see FAQ. Binary sketch size went up to 7258 bytes, but a 7168 byte maximum.
The FAQ says "The ATmega8 chip on the Arduino board is cheap, but it has only 8 Kb of program code, which isn't very much (and 1 Kb is used by the bootloader). If you're using floating point, try to rewrite your code with integer math, which should save you about 2 Kb. Delete any #include statements at the top of your sketch for libraries that you're not using."
After I changed float to int, size went down to 4408 bytes.

Hardware is simple, just switch(+10K ohm) and LED(+220 ohm).
LED blinks, five steps.
1. Blinks, delay 1000 msec,
2. 24 blinks per sec
3. 30 blinks per sec
4. 40 blinks per sec
5. LED light up
I could recognize blinking of 24 and 30 blinks/sec, but not 40 blinks/sec. In the case of 40 blinks/sec, brightness was little bit darker than usual so that I put a 5th step for comparing with normal LED light. I searched about this phenomenon. It is called, Pulse-width modulation. According this fact, we can slightly change the power of electronic component such as speed of motor, brightness of LED.
I took this video clip using Sony DSC T10 digital camera so that I couldn't see the blinking well. I think the reason is video capturing spec of this camera. |