“Somatosensory interaction - Potentiometer”的版本间的差异

来自Microduino Wikipedia
跳转至: 导航搜索
(Created page with "{| style="width: 800px;" |- | ==Objective== This tutorial will teach you how to use the potentiometer to control Processing, then to control the movement of smile face on scr...")
 
Pkj讨论 | 贡献
 
第1行: 第1行:
 +
{{Language | 体感互动-电位器}}
 
{| style="width: 800px;"
 
{| style="width: 800px;"
 
|-
 
|-
第17行: 第18行:
 
**Breadboard Jumper  onebox
 
**Breadboard Jumper  onebox
  
{{Language | 体感互动-电位器}}
 
 
==Schematic==
 
==Schematic==
  

2014年5月16日 (五) 01:19的最新版本

Language English

Objective

This tutorial will teach you how to use the potentiometer to control Processing, then to control the movement of smile face on screen.

Equipment

  • Other equipment
    • USB cable one
    • RGB LED one
    • 330Ω resistor one
    • Bread one
    • Breadboard Jumper onebox

Schematic

InteractivePotentiometerSchematics.jpg

Program

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

Debug

Step 1:Set up hardware system, as follows:

InteractivePotentiometerConnectionDiagram.jpg

Step 2:Explain the code:

//Read potentiometer's simulation value, and assign values to the smiling face of the x coordinate values

 void draw() {
   sensorValue = arduino.analogRead(potPin); //Reading the value of the potentiometer
   background(255);
   image(face,sensorValue,80);
 }

Step 3: Compile the code and download it.

Step 4: After running, a smile face will display on the left side, rotate the potentiometer and then observe the smile face's change.

Result

The smiling face on the screen will move around with the potentiometer's rotation, as follows:

InteractivePotentiometerResult.jpg

Video