Somatosensory interaction - An arrow through a heart
From Microduino Wiki
Language: | English • 中文 |
---|
ObjectiveThis tutorial will show that use the hall sensor to realize the effect of an arrow through a heart. Equipment
SchematicProgramhttps://github.com/Microduino/Microduino_Tutorials/tree/master/Microduino_Processing/StoneMandrel DebugStep 1: Set up hardware system, as follows: 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. ResultAfter run the program, following picture will display: The magnet close to hall sensor, the following picture will display: Video |