risknfun's blog    |  go to risknfun's homepage
Blog Main
Tag | Guestbook | Admin   
 
Arduino에 해당하는 글 2건
2007/03/21   Actions, Events and Filtering (254)
2006/09/14   Arduino Programming (189)


Actions, Events and Filtering
For Actions, Events and Filtering assignment, I made a very simple game that uses a flex sensor and a player only can solve it by a specific way of bending it rather than just bend normally.


Here is the description of this assignment.



I simply build the hardware part using Arduino and software part using Processing that are connected through serial communication. In this game, which is similar to unlock the padlock, a player should bend the flex sensor a specific way and the specific time. For example, Step 1. bend forward and keep it more than 5 seconds but less than 8 seconds, Step 2. release and keep about 3 seconds, Step 3. bend backward and keep it more than 7 seconds.

(cubic equation graph from wikipedia)


Actually, my initial concept was that using a differential of a equation such as a cubic equation, however, my flex sensor was quite unstable so I needed an extra work(ex, averaging). Therefore,  I just use the sensor value and the time as a variable.


the lock will not be solved when a player bend it without knowing specific steps.



the lock was solved by the specific way described above.
Tag : Arduino, ITP, Processing, sensor


Arduino Programming
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.
Tag : Arduino, Physical Computing