'rotary'에 해당되는 글 1건

  1. 2016.09.18 Taper Rotary Potentiometer B10K (B10K) [S060]

Taper Rotary Potentiometer B10K (B10K) [S060]



https://www.youtube.com/watch?v=VMQ_LH0NPps


*GitHubhttps://github.com/rdiot/rdiot-s060.git


* Specs

Manufacturer: ALPHA

Manufacturer Part No: B10K OHM 17mm

Comes with Dust Seal


Specifications

Adjustment Type: Top Adjustment

Power: 1/2W

Resistance: 10K OHM OHMS

Type: Linear

Type B

Features

Knurled Shaft

Suits Most Standard knobs

Shaft Diameter: 6mm

Shaft Length: 10mm

Mounting Hole: 7.5mm

Base Diameter: 16mm


* Contents

- Connect

Left - 5V

Middle - A0 (OUT)

Right - GND


- Key Code

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>


LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004

int potPin = A0;

int val;


void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");


  //pinMode(potPin, INPUT);

  delay(1000);


  lcd.clear();

}


void loop()

{

  lcd.setCursor(0,0);

  lcd.print("S060:B10K");


  val = analogRead(potPin);


  lcd.setCursor(0,1);

  lcd.print("analog=" + (String)val + "  " );


  val = map(val, 0, 1021, 100, 1);

 

  lcd.setCursor(0,2);

  lcd.print("val1~100=" + (String)val + "  " );


  delay(10);

}

Posted by RD IoT RDIoT

댓글을 달아 주세요