Somatosensory interaction - An arrow through a heart

From Microduino Wiki
Revision as of 13:06, 19 May 2014 by Pkj (talk) (Created page with "{{Language | 体感互动-一箭穿心}} {| style="width: 800px;" |- | ==Objective== This tutorial will show that use the hall sensor to relize the effect of an arrow through...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Language: English  • 中文

Objective

This tutorial will show that use the hall sensor to relize the effect of an arrow through a heart.

Equipment

  • Other equipment
    • USB cable one
    • hall sensor one
    • The magnet one
    • 330Ω resistor one
    • Bread one
    • Breadboard Jumper onebox


Schematic

StoneMandrelSchematics.jpg

Program

https://github.com/Microduino/Microduino_Tutorials/tree/master/Microduino_Processing/StoneMandrel

Debug

Step 1:Set up hardware system, as follows:

StoneMandrelConnectionDiagram.jpg

Step 2: Explain the code:

//Check if the magnet close to hall sensro

 void draw() {
   statePin=arduino.digitalRead(hallPin);
   if ( statePin==Arduino.HIGH) {
     image(stoneMandrel1, 0, 0);
   } else if (statePin==Arduino.LOW) {
     image(stoneMandrel2, 0, 0);
   }
 }

Step 3: Compile the code and download it.

Step 4: After running, a target will display on screen. When the magnet close to hall sensor, then observe the result.

Result

After run the program, following picture will display:

StoneMandrelResult1.jpg

The magnet close to hall sensor, the following picture will display:

StoneMandrelResult2.jpg

Video