Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
gripper test for arcbotics sparki.
#include <Sparki.h>
void beepx(int x, int d){
for (int i = 0; i < x; i++){
delay(d);
sparki.beep();
}
}
void gripperTestA(){
int interval;
for (int cm = 1; cm < 7; cm++){
interval = cm*1000 + 1500;
sparki.gripperOpen(cm);
beepx(1, interval);
sparki.gripperClose(cm);
beepx(1, interval);
}
}
void gripperTestB(){
for (int interval = 1; interval < 7; interval++){
sparki.gripperOpen();
beepx(1, interval*1000);
sparki.gripperStop();
beepx(1, 1500);
sparki.gripperClose(interval*1000);
beepx(1, interval*1000);
sparki.gripperStop();
beepx(1, 1500);
}
}
void gripperTestC(){
for (int interval = 1; interval < 7; interval++){
sparki.gripperOpen();
beepx(1, interval*1000);
sparki.gripperClose(interval*1000);
beepx(1, interval*1000);
}
}
void setup(){
gripperTestA();
gripperTestB();
gripperTestC();
}
void loop(){
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment