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++
