Hackster is hosting Hackster Holidays, Ep. 6: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Monday!Stream Hackster Holidays, Ep. 6 on Monday!
Peter Cuellar
Created November 30, 2015

Distance Measuring Sensor Experimentation

Using the Sharp Proximity Sensor to

Showcase (no instructions)17
Distance Measuring Sensor Experimentation

Story

Read more

Code

Proximity Sensor

C/C++
int sensorPin = 0; //analog pin 0

void setup(){
  Serial.begin(9600);
}

void loop(){
  int val = analogRead(sensorPin);
  Serial.println(val);

  //just to slow down the output - remove if trying to catch an object passing by
  delay(100);

}

Credits

Peter Cuellar

Peter Cuellar

10 projects • 2 followers
Designer, Engineer, Environmentalist

Comments