There is currently only one example sketch that comes with hexy:
#include "Servotor32.h" // call the servotor32 Library
Servotor32 hexy; // create a servotor32 object
void setup() {
hexy.begin();
}
void loop() {
// blink the status led
digitalWrite(STATUS_LED, HIGH);
hexy.delay_ms(500); // wait 500mS
digitalWrite(STATUS_LED, LOW);
hexy.delay_ms(500); // wait 500mS
// kill all servos
for(int i=0; i<32; i++){
hexy.changeServo(i,-1);
}
// center servos 0,1,2,3
hexy.changeServo(0,1500);
hexy.changeServo(1,1500);
hexy.changeServo(2,1500);
hexy.changeServo(3,1500);
hexy.delay_ms(100); // wait 100mS
while(true){
// get a ping from the ultrasonic sensor in CM
//Serial.print("CM: ");
//Serial.println(hexy.ping());
//hexy.delay_ms(200); // wait 200mS
hexy.process(&Serial); //process input from the USB
hexy.process(&Serial1); //process input from the board serial (i.e. bluetooth)
}
}
You can see where it has it move on of the servos:
hexy.changeServo(3,1500);
1500 is center, 500 is full left rotate 90 degrees, and 2500 is full right rotate 90 degrees.
Although it runs an Arduino controller and can be programmed as such, its primarily intended to be used with PoMoCo. We’re are working on an Arduino move code generator, but that won’t be until the next PoMoCo release. We have also hired a tutorial writer, who is working on Sparki right now, and will be working on Hexy after they’re done in a month or so. If you need a basic Arduino code tutorial, the Sparki one covers the basics:
arcbotics.com/lessons/basic-code/