I have assembled my robot now. When I turn on power from my 9v battery, the yellow light turns on as well as another yellow, red, and green light. There is an almost chirping sound every 2 seconds.
I also haven’t configured my PS2 receiver yet. Not sure how to do so. All the guides I find seem to refer to the SSC board…
The only connections I’ve made into my botboarduino so far have been the power ones and my servos. Not sure what else to do. I’ve installed all the necessary software on my computer.
Where do I go from here? I"d appreciate a fast answer. Thanks.
I’m pretty sure my wiring is correct. Should I have the VS=VL jumper removed or on there? I have the USB jumper right. It uploaded the PS3 controller stuff fine. How do I run it though? I tried starting the robot up and nothing happens.
If you are powering your logic voltage from your USB, and using a wall adapter or battery pack to power the servos, the two voltages are not from the same supply, so you would need to remove VL=VS. Hopefully nothing was damaged.
Hopefully you mean PS2? You need to ensure it’s connected properly to the board. Which cables are you using? Note that the PS2C (the old cable) cannot be used with the new RC-01 V2 remote system. If you have configured everything correctly, check the code to see what you need to do to get the arm working.
I’m pretty sure it’s connected fine. What code can I use to do some simple servo tests before using the PS2 controller? I can’t seem to find any API. Also, there’s not much really in the code. Once it’s successfully uploaded, is there anything I need to do to get it started?
You can use the servo example in the Arduino software and test with each channel.
Note that you will need to take the time to understand the code in order to modify it.
The arm code for the PS2 needs to be modified so the pins which are physically connected to the BotBoarduino are the same pin numbers indicated in the code.
Arduino servo test code for use with the arduino IDE serial monitor.
// zoomkat 10-22-11 serial servo test
// type servo position 0 to 180 in serial monitor
// or for writeMicroseconds, use a value like 1500
// for IDE 0022 and later
// Powering a servo from the arduino usually *DOES NOT WORK*.
String readString;
#include <Servo.h>
Servo myservo; // create servo object to control a servo
void setup() {
Serial.begin(9600);
myservo.writeMicroseconds(1500); //set initial servo position if desired
myservo.attach(7); //the pin for the servo control
Serial.println("servo-test-22-dual-input"); // so I can keep track of what is loaded
}
void loop() {
while (Serial.available()) {
char c = Serial.read(); //gets one byte from serial buffer
readString += c; //makes the string readString
delay(2); //slow looping to allow buffer to fill with next character
}
if (readString.length() >0) {
Serial.println(readString); //so you can see the captured string
int n = readString.toInt(); //convert readString into a number
// auto select appropriate value, copied from someone elses code.
if(n >= 500)
{
Serial.print("writing Microseconds: ");
Serial.println(n);
myservo.writeMicroseconds(n);
}
else
{
Serial.print("writing Angle: ");
Serial.println(n);
myservo.write(n);
}
readString=""; //empty for next input
}
}
My understanding is that the botboarduino is arduino compatable, so I would think you would connect the botboarduino to your pc with a mini USB cable and then run the arduino IDE to upload the code and run the code.
You may need to compare the code I posted to how servos would actually connect to your board. Perhaps lynxmotion can provide some simple servo test code for their board that takes into account any differences in their board’s wiring and the typical arduino.
Check the serial terminal window. Also, you might have the servo commands inverted - you send a servo signal, but only indicate which pin it’s connected to on the next line.
I just uploaded this script and had no response once I uploaded it:
[code]#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(2); // attaches the servo on pin 9 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
}
}[/code]
Your servos look like they are connected backwards - the black wire is connected to GND.
Also, what do you have connected to pins 6 to 9?
Remove all the wires connected to the digital pins and connect only ONE servo (you choose the pin). Connect the 9V and wall adapter, and try to use the servo sweep example to have that servo sweep back and forth.
Pins 6-9 were the PS2 adapter wires. I connected a servo to #2 on the board with the black wire on GND and removed all other wires. I uploaded this code:
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(2); // attaches the servo on pin 9 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
}
}
Nothing happened. Is there any button I have to press to execute it after upload?