Initial commit
This commit is contained in:
commit
2cb72a73e8
8 changed files with 143 additions and 0 deletions
17
magic-veneer-arduino/src/main.cpp
Normal file
17
magic-veneer-arduino/src/main.cpp
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#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();
|
||||
Serial.println(distance);
|
||||
}
|
||||
Reference in a new issue