16 lines
324 B
C++
16 lines
324 B
C++
#include "MeMCore.h"
|
|
|
|
MeUltrasonicSensor ultrasensor(PORT_3);
|
|
void setup() {
|
|
// put your setup code here, to run once:
|
|
Serial.begin(9600);
|
|
}
|
|
|
|
void loop() {
|
|
// put your main code here, to run repeatedly:
|
|
Serial.print("Distance: ");
|
|
Serial.print (ultrasensor.distanceCm());
|
|
Serial.println (" cm");
|
|
delay(500);
|
|
}
|