Potentiometer JP: 두 판 사이의 차이

아두위키 : Arduwiki
(새 문서: center|class=coders100 This device can vary its resistance. It can be used to adjust the volume or the brightness of a light. == '''Required Hardware''' == * Variable resistor (B10K used in this text) * Arduino UNO * UNO Cable * Breadboard * M-M Cable (3 pieces) == '''Connection''' == * Power is applied to the left and right, with the output coming from the middle. * Power is applied to either the left or right, with the opposite terminal con...)
 
잔글편집 요약 없음
 
(같은 사용자의 중간 판 하나는 보이지 않습니다)
1번째 줄: 1번째 줄:
[[File:가변저항b10k.jpg|center|class=coders100]]
{{#seo:|title=アルドゥウィキ:アルドゥイーノ可変抵抗器(ポテンショメーター)ガイド|title_mode=append|keywords=アルドゥイーノ, 情報科学, メーカー学習, パフォーマンス評価, 可変抵抗器(ポテンショメーター), アルドゥイーノプロジェクト, キャップストーンプロジェクト, アルドゥイーノサンプルコード|description=アルドゥイーノで可変抵抗器(ポテンショメーター)を活用する方法(基本情報、回路、サンプルコード)を紹介します。情報科学とメーカー授業で活用できます。}}[[File:가변저항b10k.jpg|center|class=coders100]]


この装置は抵抗を変えることができます。
音量や光の明るさを調整するのに使用できます。


This device can vary its resistance.


It can be used to adjust the volume or the brightness of a light.
== '''必要なハードウェア''' ==
 
* 可変抵抗器(本文ではB10Kを使用)
== '''Required Hardware''' ==
 
* Variable resistor (B10K used in this text)
* Arduino UNO
* Arduino UNO
* UNO Cable
* UNOケーブル
* Breadboard
* ブレッドボード
* M-M Cable (3 pieces)
* M-Mケーブル(3本)


== '''Connection''' ==


* Power is applied to the left and right, with the output coming from the middle.
== '''接続''' ==
* Power is applied to either the left or right, with the opposite terminal connected to GND.
* 左右に電源を接続し、中央から出力が得られます。
* Connecting as described, turning to the right increases the value, but if connected oppositely (right to GND, left to 5V), turning to the left increases the value.
* 左右どちらかに電源を接続し、反対側の端子をGNDに接続します。
* 説明通りに接続すると、右に回すと値が増加しますが、逆に接続すると(右をGND、左を5Vに)、左に回すと値が増加します。


{| class="wikitable"
{| class="wikitable"
|+
|+
!Variable Resistor
!可変抵抗器
!Arduino UNO
!Arduino UNO
|-
|-
36번째 줄: 34번째 줄:
[[File:가변저항 회로.png|center|class=coders100]]
[[File:가변저항 회로.png|center|class=coders100]]


== '''Example Code''' ==
== '''サンプルコード''' ==
<syntaxhighlight lang="c++">
<syntaxhighlight lang="c++">
#define input A0
#define input A0
42번째 줄: 40번째 줄:
void setup()
void setup()
{
{
   // Start serial communication
   // シリアル通信を開始
   Serial.begin(9600);
   Serial.begin(9600);
   Serial.println("start");
   Serial.println("start");
50번째 줄: 48번째 줄:
void loop()
void loop()
{
{
   // Display the value of the variable resistor on the serial monitor
   // 可変抵抗器の値をシリアルモニターに表示
   Serial.println(analogRead(input));
   Serial.println(analogRead(input));
   delay(1000);
   delay(1000);

2025년 3월 20일 (목) 19:49 기준 최신판

この装置は抵抗を変えることができます。 音量や光の明るさを調整するのに使用できます。


必要なハードウェア

  • 可変抵抗器(本文ではB10Kを使用)
  • Arduino UNO
  • UNOケーブル
  • ブレッドボード
  • M-Mケーブル(3本)


接続

  • 左右に電源を接続し、中央から出力が得られます。
  • 左右どちらかに電源を接続し、反対側の端子をGNDに接続します。
  • 説明通りに接続すると、右に回すと値が増加しますが、逆に接続すると(右をGND、左を5Vに)、左に回すと値が増加します。
可変抵抗器 Arduino UNO
Left GND
Middle A0
Right 5V

サンプルコード

#define input A0

void setup()
{
  // シリアル通信を開始
  Serial.begin(9600);
  Serial.println("start");
  Serial.println("======================");
}

void loop()
{
  // 可変抵抗器の値をシリアルモニターに表示
  Serial.println(analogRead(input));
  delay(1000);
}