21 lines
351 B
C++
21 lines
351 B
C++
#include "Arduino.h"
|
|
#include "Wire.h"
|
|
#include "MeMCore.h"
|
|
#include "SoftwareSerial.h"
|
|
|
|
MeUltrasonicSensor ultrasonicSensor(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:
|
|
delay(2000);
|
|
Serial.println(ultrasonicSensor.distanceCm());
|
|
|
|
}
|