Show Posts
Pages: [1]
1  Using Arduino / Programming Questions / Re: Im getting an error: expected unqualified-id before "{" token, can someone help? on: April 27, 2012, 06:35:29 pm
Yep.. Looks like you got a little carried away with the whole  {   } concept... I think you meant to write something like this.


#include <Servo.h>
 
Servo servoLeft;          // Define left servo
Servo servoRight;         // Define right servo

int potpin0 = 0;
int potpin1 = 1; // analog pin used to connect the potentiometer
int val1;
int val0; // variable to read the value from the analog pin
 
void setup()
{
  servoLeft.attach(9);  // attaches the servo on pin 9 to the servo object
  servoRight.attach(10);
 
 }
 

void loop()
{
  val1 = analogRead(potpin0);
  val0 = analogRead(potpin1);  // reads the value of the potentiometer (value between 0 and 1023)
  val0 = map(val0, 0, 1023, 0, 179);
  val1 = map(val1, 0, 1023, 0, 179);  // scale it to use it with the servo (value between 0 and 180)
  servoLeft.write(val0);
  servoRight.write(val1);    // sets the servo position according to the scaled value
  delay(15);                           // waits for the servo to get there
}

// Motion routines for forward, reverse, turns, and stop
/*example code and is not needed and is commented out
{
  servoLeft.write(val0);
  servoRight.write(val1);
  delay(20);
}*/
2  Topics / Robotics / Re: Beginnings of my Arduino PAN/Tilt/Zoom camera controller on: April 27, 2012, 06:19:14 pm
I love it!   I am re-writing a a robotic video compression suite and I think this is exactly what I need.  How did you interface the zoom functionality to the arduino?  I have been looking at a lot of security cameras that use the Pelco-D protocol but they require an RS-458 serial connection to send the data across.  The origional suite was written in player/Stage for a robotics competition last year..  Problem with player is that it was not meant for streaming video and drops frames which very bad for mpeg4 compression.  Hence the re-write.  Along with the rewrite, however, I am looking to add better PTZ functionality and higher resolution cameras; the last one used a logitech orbit which is not incredibly fancy..  the PT is easy using an arduino and a couple of servos but interfacing the zoom capability is what is tripping me up.  Can you post your wiring schematic for the final camera and the final camera you used?  Maybe the code as well?

I read the schematic for the EVI-401 did you send the commands to the camera via the RS-232c, the TTL, or the VISCA interface?

When I get around to writing the camera suite, I will be sure to let you know...
Pages: [1]