Sparki servo zero offset

Hello,

Another beginner question… Zero degree for the servo on my Sparki is really not zero. I’ve removed the screw holding the ultrasonic board and I’ve tried to reset it in the right angle, but since there are “teeth”, it’s either a few degrees too much anti-clockwise or a few degrees (even more) clockwise.

There may be obvious way to tune this, but I have no or too little background in this domain…

Thanks!

There’s not an obvious way to tune this, but there is a way. The head is tuned to be centered at the factory, and is stored inside the EEPROM at address 0x00. You should be able to change it by uploading this code:

#include <Sparki.h>  // include the robot library
#include <EEPROM.h>
 
void setup() {
 EEPROM.write(0, 1); // tells the Sparki its servo offset is at 1 degrees
 //EEPROM.write(0, 5); // tells the Sparki its servo offset is at 5 degrees
 //add 127 for negative degrees
 //EEPROM.write(0, 128); // tells the Sparki its servo offset is at -1 degrees
 //EEPROM.write(0, 132); // tells the Sparki its servo offset is at -5 degrees
}
 
void loop() {
}