Slide Pot 10K Module [S061]
https://www.youtube.com/watch?v=cJkjxeIvFuM
*GitHub : https://github.com/rdiot/rdiot-s061.git
* Specs
Two analog outputs, analog outputs 0-VCC voltage signals
Size: 90 * 20mm / 0.39*0.78"
Voltage: 3.3V or 5V
Port: Analog
Resistance: 10K
Quantity:1pc
* Contents
- Connect
GND ----- X
VCC ----- X
OTB ----- A1
GND ----- GND
VCC -----5V
OTA ----- A0
- Key Code
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,20,4); // LCD2004
int pot1Pin = A0;
int pot2Pin = A1;
int val;
void setup()
{
lcd.init(); // initialize the lcd
lcd.backlight();
lcd.print("start LCD2004");
delay(1000);
lcd.clear();
}
void loop()
{
lcd.setCursor(0,0);
lcd.print("S061:Slide Pot");
lcd.setCursor(0,1);
lcd.print("OTA=" + (String)analogRead(pot1Pin) + " -> " + (String)map(analogRead(pot1Pin), 0, 1021, 0, 100) + " " );
lcd.setCursor(0,2);
lcd.print("OTB=" + (String)analogRead(pot2Pin) + " -> " + (String)map(analogRead(pot2Pin), 0, 1021, 0, 100) + " ");
delay(10);
}
'2) Sensor > Potentiometer' 카테고리의 다른 글
3362P 10K Trimmer Potentiometer (3362P-10K) [S091] (0) | 2016.09.18 |
---|---|
3296W Multiturn Trimmer Potentiometer (3296W) [S089] (0) | 2016.09.18 |
Linear Potentiometer B1K~B1M (B1K~B1M) [S070] (0) | 2016.09.18 |
Taper Rotary Potentiometer B10K (B10K) [S060] (0) | 2016.09.18 |
Amp Pot B5K (B5K) [S027] (0) | 2016.09.18 |