Last active
April 25, 2019 06:42
-
-
Save timlambrecht/29ded1ff87dd9e53f1d53b6fcd512c88 to your computer and use it in GitHub Desktop.
Code for three sensors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "MeOrion.h" | |
MeUltrasonicSensor SensorL(PORT_3); | |
MeUltrasonicSensor SensorM(PORT_7); /* Ultrasonic module can ONLY be connected to port 3, 4, 6, 7, 8 of base shield. */ | |
MeUltrasonicSensor SensorR(PORT_8); | |
void setup() | |
{ | |
Serial.begin(9600); | |
} | |
void loop() | |
{ | |
Serial.print("SensorL : "); | |
Serial.print(SensorL.distanceCm() ); | |
Serial.println(" cm"); | |
Serial.print("SensorM : "); | |
Serial.print(SensorM.distanceCm() ); | |
Serial.println(" cm"); | |
Serial.print("SensorR : "); | |
Serial.print(SensorR.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