This repository has been archived on 2026-03-12. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
magic-veneer/magic-veneer-arduino/src/main.cpp
2020-09-17 12:50:53 +02:00

22 lines
No EOL
333 B
C++

#include <Arduino.h>
#include <SharpIR.h>
SharpIR sensor(SharpIR::GP2Y0A02YK0F, A0);
void setup()
{
Serial.begin(9600);
pinMode(A0, INPUT);
// put your setup code here, to run once:
}
void loop()
{
int distance = sensor.getDistance();
if (distance < 40)
{
Serial.println("isWithinThreshhold");
}
delay(100);
}