diff --git a/gyro/gyro.ino b/gyro/gyro.ino new file mode 100644 index 0000000..6cf1a07 --- /dev/null +++ b/gyro/gyro.ino @@ -0,0 +1,23 @@ +#include"MeMCore.h" +#include +MeGyro gyro; + +void setup() { + // put your setup code here, to run once: +Serial.begin(115200); + gyro.begin(); +} + +void loop() { + // put your main code here, to run repeatedly: + gyro.update(); + Serial.read(); + Serial.print("X:"); + Serial.print(gyro.getAngleX() ); + Serial.print(" Y:"); + Serial.print(gyro.getAngleY() ); + Serial.print(" Z:"); + Serial.println(gyro.getAngleZ() ); + Serial.println(gyro.getGyroY()); + delay(10); +} \ No newline at end of file diff --git a/roomba/roomba.ino b/roomba/roomba.ino index 95c2b6e..68703b3 100644 --- a/roomba/roomba.ino +++ b/roomba/roomba.ino @@ -1,9 +1,27 @@ -void setup() { - // put your setup code here, to run once: +#include "MeMCore.h" +MeDCMotor motor1(9); + +MeDCMotor motor2(10); + +MeUltrasonicSensor ultraSensor(PORT_3); + +int minDistance = 15; + +void setup() { + Serial.begin(9600); } void loop() { - // put your main code here, to run repeatedly: + + if (ultraSensor.distanceCm()