Somatosensory interaction - An arrow through a heart

From Microduino Wiki
Revision as of 09:10, 13 September 2016 by Fengfeng (talk)
(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 realize 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 sensor

 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