Skip to content

Instantly share code, notes, and snippets.

@timlambrecht
Created March 15, 2019 09:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timlambrecht/26a976797aa0049b1add0cde87dc55d2 to your computer and use it in GitHub Desktop.
Save timlambrecht/26a976797aa0049b1add0cde87dc55d2 to your computer and use it in GitHub Desktop.
Code for one sensor
#include "MeOrion.h"
MeUltrasonicSensor SensorM(PORT_7); /* Ultrasonic module can ONLY be connected to port 3, 4, 6, 7, 8 of base shield. */
void setup()
{
Serial.begin(9600);
}
void loop()
{
Serial.print("SensorM : ");
Serial.print(SensorM.distanceCm() );
Serial.println(" cm");
delay(100); /* the minimal measure interval is 100 milliseconds */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment