Show Posts
Pages: [1]
1  Using Arduino / Sensors / Re: Parallax Si1143 Proximity Sensor on: March 18, 2013, 01:31:01 pm
The thing is the Si1143 works kind of different to all other infrared sensors...it communicates using I2C insted of the way Sharp sensors do...
2  Using Arduino / Sensors / Parallax Si1143 Proximity Sensor on: March 18, 2013, 12:30:16 pm
I bought the Parallax Si1143 Proximity Sensor from Parallax which works with I2C. This sensor is pretty new and all the code to use it is written in BASIC, which I don't know how to use...
I'm trying to use the sensor with Arduino using the wire.h library but I can't get it to work.
Any ideas? help?
thanks! from Chile

Cris
3  International / Hardware / Velocidad de un servo on: November 25, 2012, 02:15:15 am
Necesito programar un servo para que haga un movimiento en 90°,  de ida y vuelta constantemente, y que vaya acelerando la velocidad del movimiento. Llegado a un punto máximo, quiero que se detenga. Es decir, de A a B -ida y vuelta - acelerando hasta un máximo para detenerse en seco.

Estuve probando con éste código pero no logro obtener el resultado que necesito.

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(9);  // attaches the servo on pin 9 to the servo object
}
 
 
void loop()
{
  slowspeed();
  delay(15);
  medspeed();
  delay(100);
  fastspeed();
  delay(1000); 
 
}

void slowspeed(){
  for(pos = 0; pos < 180; pos += 2)  // goes from 0 degrees to 180 degrees
  {                                  // in steps of 2 degree
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
  }
 delay(15);
}

void medspeed(){
  for(pos = 0; pos < 180; pos += 5)  // goes from 0 degrees to 180 degrees
  {                                  // in steps of 5 degree
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
  }
  delay(50);
}

void fastspeed(){
  for(pos = 0; pos < 180; pos += 9)  // goes from 0 degrees to 180 degrees
  {                                  // in steps of 9 degree
    myservo.write(pos);      // tell servo to go to position in variable 'pos'
  }
  delay(150);
}

Alguna idea?
4  Using Arduino / Motors, Mechanics, and Power / Re: Servo Movement. Help! on: November 24, 2012, 09:31:53 pm
Quote
Well your slowest speed function is using the shortest delay and your fastest speed function is using the longest delay, does that sound logical and correct to you? Less time delay = faster for loop cycle time so servo commands sent faster. Also all your for statements should just increment the position by one degree each cycle.

I changed the delay on the functions but its still not working...the servo just makes like small quick movements

Quote
don't have a clue as you have yet to send a link to where someone can find that library.

Here's the link http://arduino.cc/forum/index.php/topic,61586.0.html

Quote
We should also asK - how are you powering the servos ?

Check the two links below for why this matters and a quick fix.

Thaks for the links Duane
Just for quick testing the code I'm using a micro servo connected to the 5v arduino entry. I think its enough? There's nothing else conected to it...
5  Using Arduino / Motors, Mechanics, and Power / Re: Servo Movement. Help! on: November 24, 2012, 08:59:19 pm
Thanks for the replies...

So I must change the delay between each increment? Something like this:?

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(9);  // attaches the servo on pin 9 to the servo object
}
 
 
void loop()
{
  slowspeed();
  delay(15);
  medspeed();
  delay(100);
  fastspeed();
  delay(1000); 
 
}

void slowspeed(){
  for(pos = 0; pos < 180; pos += 2)  // goes from 0 degrees to 180 degrees
  {                                  // in steps of 2 degree
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
  }
 delay(15);
}

void medspeed(){
  for(pos = 0; pos < 180; pos += 5)  // goes from 0 degrees to 180 degrees
  {                                  // in steps of 5 degree
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
  }
  delay(50);
}

void fastspeed(){
  for(pos = 0; pos < 180; pos += 9)  // goes from 0 degrees to 180 degrees
  {                                  // in steps of 9 degree
    myservo.write(pos);      // tell servo to go to position in variable 'pos'
  }
  delay(150);
}


But it's not working... the servo seems stuck.


So whats the VarSpeedServo lib for? I thougth it was to controll the speed of a servo?
The code I'm using is one I got from another post

Code:
#include <VarSpeedServo.h>

int pos = 0;    // variable to store the servo position
VarSpeedServo myServo;
void setup()
{
myServo.attach (9);
}
 
 
void loop()
{
  for(pos = 0; pos < 180; pos += 180)  // goes from 0 degrees to 180 degrees
  {                                  // in steps of 1 degree
  myServo.slowmove (pos,1);             // 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-=180)     // goes from 180 degrees to 0 degrees
  {                               
    myServo.slowmove (pos,1);
 
    delay(15);                       // waits 15ms for the servo to reach the position
  }
}


The idea is the servo moves 90° (form point A to point B, back and forth) continuously while the speed of the movement increases in the meanwhile
until it reaches the maximun speed posible and it stops...This project is part of a bigger project I'm working on, which involes a kind of performatic device...
6  Using Arduino / Motors, Mechanics, and Power / Servo Movement. Help! on: November 24, 2012, 07:07:48 pm
I want to control two servos to move back and forth while increasing their speed and when they reach max speed, to stop. Then, wait for a couple of seconds and start the loop again.
Any idea how to make it? I've been trying with the sweep code at differents steps
Code:
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 = 0; pos < 180; pos += 5)  // 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
  }

But it dosen't seem to work.
Then, I tried with the Varspeedservo lib, but I keep getting this error when compiling:
Quote
'VarSpeedServo' does not name a type
I tried with Arduino 1.0 and 1.0.1
I'm kind of newbie so any help will be helpful!
Thanks from Chile
Pages: [1]