Introduction
The DFRobot Rotation Sensor V1 is arduino compatible and can be rotated upto 300-degree. It is based on a simple potentiometer. With the Arduino sensor expansion board, it very easily achieve position-dependent interaction with a rotattion trigger or even produce MIDI instrument.
Specification
- Interface type: Analog
- 300 degree rotation sensor
Pin Definition
The definition of gas sensor pin is
- Signal Output
- GND
- Power
Connection Diagram
Sample Code
// # Editor : Lauren from DFRobot
// # Date : 30.12.2011
// #
// # Editor : Lauren from DFRobot
// # Date : 17.01.2012
// # Product name: Rotation Sensor v1/v2 or Analog Slide Position Sensor
// # Product SKU : DFR0054/DFR0058/DFR0053
// # Version : 1.0
// # Description:
// # the sample to drive some analog sensors
// # Connection:
// # Signal output pin -> Analog pin 0
// #
void setup()
{
Serial.begin(9600); //Set serial baud rate to 9600 bps
}
void loop()
{
int val;
val=analogRead(0); //Read slider value from analog 0
Serial.println(val,DEC);//Print the value to serial port
delay(100);
}