Arduino config question

Hey everybody, I just got my hexy all put together and I’m trying to get it to work with the arduino programmer, I’ve set it to work with a leonardo board on com 6 (although it changes briefly to servo 32 “something” on com7 during the last second or so when writing) I’m using example code and all I did is change the pin number to make hexy’s head move but nothing happens. This is the code I used:
#include <Servo.h>

Servo myservo; // create servo object to control a servo
// a maximum of eight servo objects can be created

int pos = 0; // variable to store the servo position

void setup()
{
myservo.attach(31); // attaches the servo on pin 31 to the servo object
}

void loop()
{
for(pos = 0; pos < 180; pos += 1) // goes from 0 degrees to 180 degrees
{ // in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos’
delay(15); // waits 15ms for the servo to reach the position
}
for(pos = 180; pos>=1; pos-=1) // goes from 180 degrees to 0 degrees
{
myservo.write(pos); // tell servo to go to position in variable 'pos’
delay(15); // waits 15ms for the servo to reach the position
}
}

Any ideas where I am doing wrong? Thanks in advance for any help, I know visual basic and assembly and this is my first experience with c++

I can see that you got your stuff together with the codes and evrything. Thats good in a way but not fully 100% coz you still running into a few problems. You’ll figure it out somehow with a little perseverance and knowledge and a little luck. But for me, I think I bit A little more than i could chew right here. I dont even know half the stuff you got there. I just wish they should have written on the box “Computer Programing Experience 'A Must”. or even at least include a book that details the instructions clearly. Instead of like leaving custumers up in the air like that in false pretenses . Having custumers excited , thinking they could build this thing , no problem and before they realize it , its too late to return it. Well ,what can we do? I probably won’t pursue this endevour any more than what I already accomplish which is nothing really. But I do want to wish you Lots of goodluck on the project and it was nice of you to understand where I’m coming from and all the head aches. So long.

The problem is not using the Servotor library. The standard Arduino servo library won’t work with Servotor. 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/

Thank you for the code, I will be trying it out in the following days as soon as I get time, however I really must say that I truly believe hexy’s getting started section is lacking, it would be very beneficial to just have that sample code you provided me with mentioned in the getting started page, I certainly did not get the impression with the sales pitch that I was buying something that was intended to be primarily used with the pomoco, I thought I was buying something that I could learn more about programming with and I honestly chose hexy over sparky because hexy simply looks cooler :wink:

Well all is going well and I’ll be off to a good start now, thanks again.