I wrote this as an experiment to see how to plot words. My hope was to get the entire alphabet upper and lower case in a library to recall so you could print anything. the problem is that I can not get it to tell the sparki to turn right. Just a heads up the “float multi” is the offset so the angles are correct as the last fix did not fix this problem. here is the code.
#include <Sparki.h> // include the sparki library
void setup() {
sparki.servo(SERVO_CENTER); // center the servo
}
//This should write the word Colton
//there is some problem at the letter n
//the moveRight(A) turns left
//does anyone have any idea why?
float n = .5; // distance to travel
float multi = 1.066; // correction for sparki angles
int a = 90; // angle to turn
float A = a * multi;
int b = 180;
float B = (a + b) * multi;
void loop() {
sparki.clearLCD(); // wipe the screen
// write the measurements to the screen
sparki.println(n);
sparki.println(a*multi);
sparki.moveForward(2); //draw Capitol C
sparki.moveLeft(A);
sparki.moveForward(4);
sparki.moveLeft(A);
sparki.moveForward(6);
sparki.moveLeft(A);
sparki.moveForward(6);
sparki.moveForward(2); //draw o
sparki.moveLeft(A);
sparki.moveForward(2);
sparki.moveLeft(A);
sparki.moveForward(2);
sparki.moveLeft(A);
sparki.moveForward(2);
sparki.moveLeft(A);
sparki.moveForward(4);
sparki.moveLeft(A); //draw l
sparki.moveForward(6);
sparki.moveBackward(6);
sparki.moveLeft(B);
sparki.moveForward(3);
sparki.moveLeft(A); //draw t
sparki.moveForward(6);
sparki.moveBackward(2);
sparki.moveLeft(A);
sparki.moveForward(2);
sparki.moveBackward(4);
sparki.moveForward(2);
sparki.moveLeft(A);
sparki.moveForward(4);
sparki.moveLeft(A);
sparki.moveForward(2);
sparki.moveForward(2); //draw o
sparki.moveLeft(A);
sparki.moveForward(2);
sparki.moveLeft(A);
sparki.moveForward(2);
sparki.moveLeft(A);
sparki.moveForward(2);
sparki.moveLeft(A);
sparki.moveForward(4);
sparki.moveLeft(A); //draw n
sparki.moveForward(2);
sparki.moveRight(A); //problem starts here
sparki.moveForward(2);
sparki.moveRight(A);
sparki.moveForward(2);
sparki.moveLeft(A);
sparki.moveForward(6);
sparki.updateLCD(); // display all of the information written to the screen
// n = n + 2; // adds 2 to the value of n (not used)
delay(10000); // wait 1 second
}
Need help please. I thing this should work.