Show Posts
Pages: [1] 2
1  Forum 2005-2010 (read only) / Syntax & Programs / Re: change Metro interval on: August 22, 2008, 05:54:36 am
ok nevermind.. it´s solved  smiley-grin



http://www.arduino.cc/playground/Code/Metro

To change the interval to 1 second use interval() like this: led_metro.interval(1000)

To restart/reset the Metro, use reset(): led_metro.reset()
2  Forum 2005-2010 (read only) / Syntax & Programs / change Metro interval on: August 21, 2008, 07:59:04 pm
Hi!
I´m using Metro lybrary to set an interval on my program.

At a specific time i need to change its duration interval but i can´t figure out how


Code:
// declare the interval with a duration variable
int duration = 250;
#include <Metro.h>
Metro checkDistance_timer = Metro (duration);

void setup() {

}


void loop() {
  if (checkDistance_timer.check() == 1) { // check if the metro has passed it's interval .
    doSomething();
  }
}


// unit here everything´s fine, the function doSomething(); is running under 250

// then under a condition i need to change the interval duration and i´m using this next code
// but with no success

duration = 9000;
checkDistance_timer.reset();



can someone help me on this?

thnx  smiley
3  Forum 2005-2010 (read only) / Interfacing / Re: Serial looses comunication between max & ardui on: July 08, 2008, 09:42:24 am
i solved my problem, i´m using 2 arduinos     8-)
4  Forum 2005-2010 (read only) / Interfacing / Serial looses comunication between max & arduino on: July 06, 2008, 10:58:34 am
I have an arduino diemicila with blinkM and with 3 FSR sensors connected.
I´m using max to send color values to BlinkM and to recieve input from the sensors.

Everything works ok for a couple of minutes and then comunication is lost.. i must reset the Serial port in max and sometimes i must close and reopen the patch..

i can´t see where is the problem, can you give me some clues to workaround and to debug this ?

thnx

5  Forum 2005-2010 (read only) / Interfacing / Re: Blinkm & Max/MSP on: July 06, 2008, 08:10:06 am
take a look in here smiley-wink

http://blog.bleything.net/2008/3/23/controlling-a-blinkm-from-max-msp
6  Forum 2005-2010 (read only) / Portugues / Re: sensor de movimento PIR on: July 28, 2008, 06:34:14 am
Viva Adilson!!

Cusiosamente nem pensei em ligar o fio do led a um pin analogico!! assim já deve dar  smiley
vou experimentar tambem usar os terminais!

e ligar ambos os GND´s

muito obrigado pela ajuda  smiley  

7  Forum 2005-2010 (read only) / Portugues / Re: sensor de movimento PIR on: July 27, 2008, 03:56:52 pm
arranjei uma solução um pouco manhosa, mas parece funcionar bem..

apontei o led que acende e apaga sempre que é detectado movimento para uma fotoresistência, e daí envio o sinal da resistencia para o arduino e faço um analogRead  smiley

8  Forum 2005-2010 (read only) / Portugues / sensor de movimento PIR on: July 27, 2008, 06:52:48 am
estou a tentar enviar o sinal de um sensor de movimento PIR para um Pin do arduino, se usar o mesmo fio que faz acender e apagar o LED do sensor, obtenho um sinal de quase 2V ..

gostava de saber se esta voltagem é suficiente para poder fazer um digitalRead do Pin, acontece que quando ligo este fio ao Pin obtenho HIGH e LOW aleatoriamente....

se alguem me souber dar uma ajuda agradeço  smiley-wink

9  Forum 2005-2010 (read only) / Troubleshooting / Re: Diferent arduinos?? on: July 26, 2008, 05:11:46 am
yeah! for sure!!
i won´t give up on this, today i will make more tests with max  smiley-wink

thanx mem
10  Forum 2005-2010 (read only) / Troubleshooting / Re: Diferent arduinos?? on: July 25, 2008, 04:27:27 pm
i forgot to say...
apparently it works ok....    but doesn´t comunicate with MAX   smiley-sad
the other arduino comunicates perfectly!!      

some voodoo here??   :o
11  Forum 2005-2010 (read only) / Troubleshooting / Re: Diferent arduinos?? on: July 25, 2008, 04:12:56 pm
thnx for answering mem!

it is really strange this problem, same sketch, same connections, same led´s....   one works, the other doesn´t..     :smiley

12  Forum 2005-2010 (read only) / Troubleshooting / Diferent arduinos?? on: July 25, 2008, 03:28:02 pm
hi, i´ve purchased 2 arduinos and i was comparing them because one works with a sketch and the other doesn´t... and i found this difference..

is this normal?

13  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: analog bug? on: July 03, 2008, 11:37:31 am
yes!! i think some the same was happening with me!!  smiley
14  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: analog bug? on: July 03, 2008, 10:48:31 am
hello mem! thank you for answering! :smiley

well, i don´t know how to explain this, i´ve disassembled the sensors and wires on the breadboard and assembled again and now everything seems to be ok!

i appreciate your help!!

regards
grooove
15  Forum 2005-2010 (read only) / Bugs & Suggestions / Re: analog bug? on: July 03, 2008, 10:11:01 am
Hi once again Ben!

I´m in front of the arduino now,  and reading the test procedure you´ve suggested, and i have some doubts:

- what is the Vcc?
- when you say to use a resistor what should be the value?

Here´s the code..  please take a look and tell me if i´m doing it the right way..   what intrigues me is that it was working really fine!! smiley

thanks once more!

Code:
int sensor1 = 0;
int sensor1Val = 0;

void setup() {
  Serial.begin(9600);
}

void loop(){
  sensor1Val = analogRead(sensor1);
  Serial.print("sensor1 = ");
  Serial.println(sensor1Val);
}
Pages: [1] 2