Hey so I am a beginner for arduino coding. And I want to connect an old diameter sensor to my arduino uno via the RS 232, i have attached the pdf for the sensor (page 18 shows the pins for the RS 232 output). How can i change my code to get the diameter readings instead of the output voltgaes?
int sensorPin = A0; // select the input pin for the ardunio
int ledPin = 13; // select the pin for the sensor
int sensorValue = ledPin; // variable to store the value coming from the sensor
void setup() {
// declare the ledPin as an OUTPUT:
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
// read the value from the sensor:
Serial.println(digitalRead(sensorPin));
// turn the ledPin on
float diameter = (sensorValue * 34.4386)/(655519-0.2221);
Serial.println(diameter);
delay(500);
}
man--optoCONTROL-2500--en.pdf (961 KB)