Floor sweeping with Servo motor

WST005

While cleaning, getting to those nasty little unreachable spaces under the beds, tables, and sofas can be a big pain. Make your own cute little home cleaner that will scrub your floor and the walls clean.

  1. Battery and Connector
  2. Arduino UNO
  3. Servo Motor
  4. Jumper Cable
  5. USB cable

    

#include <Servo.h>

Servo myservo;
int pos = 0;

void setup() {
myservo.attach(9);
}

void loop() {
for (pos = 0; pos <= 180; pos += 1) {
// in steps of 1 degree
myservo.write(pos);
delay(10);
}
delay(5000);
for (pos = 180; pos >= 0; pos -= 1) {
myservo.write(0);
delay(10);
}
}