Improved plotter


#1

The aim of this project was to build a functional plotter, but with very few makeblock parts (basically the kickstarter advanced kit together with the old expansion kit and two servo motors).

Here is a video of it drawing a square:

I know we can build much better plotters with makeblock, but I had fun making this and am proud that it works.

cheers,
paul


#2

Nice job Paul ! very very creative


#3

And a video of it making a circle:

Below also the code for the circle:

#include <Makeblock.h>
#include <Arduino.h>
#include <SoftwareSerial.h>
#include <Wire.h>

MeServo servoDriver1(PORT_1,DEV1);
MeServo servoDriver2(PORT_1,DEV2);

int xco;
int yco;
int servo1co;
int servo2co;

void setup()
{
    servoDriver1.begin();
    servoDriver2.begin();
}

void loop()
{
 for (int xco = 0; xco < 90; xco++) {
          yco = sqrt ( 8100 - ( xco * xco ) ) ;
          servo1co = xco + 90;
          servo2co = 90 - yco;
          servoDriver1.write(servo1co);
          servoDriver2.write(servo2co);
          delay(20);
 }
 for (int xco = 90; xco > 0 ; xco--) {
          yco = sqrt ( 8100 - ( xco * xco ) ) ;
          servo1co = xco + 90 ;
          servo2co = 90 + yco;
          servoDriver1.write(servo1co);
          servoDriver2.write(servo2co);
          delay(20);
 }
 for (int xco = 0; xco < 90 ; xco++) {
          yco = sqrt ( 8100 - ( xco * xco ) ) ;
          servo1co = 90 - xco ;
          servo2co = 90 + yco;
          servoDriver1.write(servo1co);
          servoDriver2.write(servo2co);
          delay(20);
 }
 for (int xco = 90; xco > 0 ; xco--) {
          yco = sqrt ( 8100 - ( xco * xco ) ) ;
          servo1co = 90 - xco ;
          servo2co = 90 - yco;
          servoDriver1.write(servo1co);
          servoDriver2.write(servo2co);
          delay(20);
 }
}

I had no internet yesterday so I had to remember the formula for drawing a circle myself, it can probably be done simpler.

cheers,
paul