Skip to content

Instantly share code, notes, and snippets.

@mithi
Last active August 29, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mithi/2bf975365b1c3a57e0de to your computer and use it in GitHub Desktop.
Save mithi/2bf975365b1c3a57e0de to your computer and use it in GitHub Desktop.
writeM wheelTest for arcbotics Sparki
#include <Sparki.h>
void beepx(int x, int d){
for (int i = 0; i < x; i++){
delay(d);
sparki.beep();
}
}
void writeM(int s){
sparki.moveForward(6*s);
sparki.moveRight(90);
sparki.moveForward(1*s);
sparki.moveRight(45);
sparki.moveForward(2.5*s);
sparki.moveLeft(90);
sparki.moveForward(2.5*s);
sparki.moveRight(45);
sparki.moveForward(1*s);
sparki.moveRight(90);
sparki.moveForward(6*s);
sparki.moveRight(90);
sparki.moveForward(1*s);
sparki.moveRight(90);
sparki.moveForward(4*s);
sparki.moveLeft(135);
sparki.moveForward(2.5*s);
sparki.moveRight(90);
sparki.moveForward(2.5*s);
sparki.moveLeft(135);
sparki.moveForward(4*s);
sparki.moveRight(90);
sparki.moveForward(1*s);
}
void wheelTest(){
beepx(3, 200);
writeM(1);
beepx(3, 200);
}
void setup(){
wheelTest();
}
void loop(){
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment