Somatosensory interaction - An arrow through a heart

来自Microduino Wikipedia
跳转至: 导航搜索
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