Helly fellow arduino peeps!
I'm trying to make a simple proximity measurement using the HSDL 9100 on an arduino uno. Im not quite sure how the circuit should look like, but it looks like the schematic on this picture: http://i.stack.imgur.com/8dnSG.png .. Serial print gives 900 and is not affected by the sensor itself. Code is given below:
int readValue;
int pwmPin = 6;
void setup(){
Serial.begin(9600);
pinMode(pwmPin, OUTPUT);
pinMode(A0, INPUT);
}
void loop(){
analogWrite(pwmPin, 127);
readValue = analogRead(A0);
Serial.println(readValue);
delay(500);
}
What are we doing wrong here? Thank you!