diff --git a/magic-veneer-arduino/src/main.cpp b/magic-veneer-arduino/src/main.cpp index 218ee37..a6381ce 100644 --- a/magic-veneer-arduino/src/main.cpp +++ b/magic-veneer-arduino/src/main.cpp @@ -1,22 +1,33 @@ #include #include -SharpIR sensor(SharpIR::GP2Y0A02YK0F, A0); +SharpIR sensorProx(SharpIR::GP2Y0A02YK0F, A0); +SharpIR sensorDown(SharpIR::GP2Y0A02YK0F, A1); void setup() { Serial.begin(9600); pinMode(A0, INPUT); - // put your setup code here, to run once: + pinMode(A1, INPUT); } void loop() { - int distance = sensor.getDistance(); + int distanceProx = sensorProx.getDistance(); + int distanceDown = sensorDown.getDistance(); + Serial.print("Proximity"); + Serial.println(distanceProx); + Serial.print("Down"); + Serial.println(distanceDown); + delay(100); - if (distance < 40) + if (distanceProx < 40) { - Serial.println("isWithinThreshhold"); + Serial.println("Through first barrier"); + } + if (distanceDown < 35) + { + Serial.println("Through second barrier"); } delay(100); } \ No newline at end of file