Show Posts
|
|
Pages: [1] 2
|
|
2
|
Using Arduino / Programming Questions / Loop problem
|
on: June 12, 2012, 12:32:52 pm
|
Hi, I need to control a electrostatic deflector that has a TTL input. I need to send a some number of pulses and the rest of the time the signal must be in HIGH. I want to decide when are going to start my pulses pushing a button, the code is pretty easy but I dont understand why it doesn't made the number of pulses of I write in the for sentence, always send more. The idea is: press the button "play" the pulses and keep in high until the button is pressed again. Thanks void loop(){ buttonState = digitalRead(buttonPin); if (buttonState == HIGH) { for (int i=0; i <= numberOfPulses; i++){ // set the LED on delay(10); digitalWrite(13, LOW); delay(10); digitalWrite(13, HIGH); } } else { digitalWrite(ledPin, HIGH); delay(100); } }
|
|
|
|
|
3
|
Topics / Science and Measurement / Sortest pulse
|
on: June 12, 2012, 10:00:58 am
|
|
Hi, I have an arduino nano with a ATmega328 and I can't make pulses shorter than 11microseconds. I'm using a 100MHz probe with a 250 bandwith oscilloscope. I have used the function delayMicrosecond but it doesn't works fine for periods shorter than 100microseconds, It seems "bad calibrated" the time that I measure it's not a linear function of the time that I put in the software. Using the __asm__("nop\n\t") I can't get pulses shorter than 11microseconds. I'm using the blink example in different pins but the same problem.
Thanks
|
|
|
|
|
5
|
International / Software / Re: Escribir Binario fácil
|
on: May 23, 2012, 04:09:39 pm
|
Si busco eso no me doy cuenta como usarlo. Habia pensado guardar la lectura del serial en un entero llamado numero, y despues la salida del bit menos significativo sera Bitread(numero,0) Entonces deberia poder escribir algo como digitalWrite(pin del menos significativo, Bitread(numero,0)) no se si interpreta HIGH como 1, pero se debe poder hacer algo asi. Escucho ofertas
|
|
|
|
|
7
|
International / Software / Re: Escribir Binario fácil
|
on: May 23, 2012, 01:59:49 pm
|
|
osea lo digo de nuevo si escribo 1 quiero tener LOW LOW LOW.... HIGH si escribo en el serial 2 a la N -1 quiero HIGH HIGH HIGH.... HIGH, para cualquier numero entero en el rango
|
|
|
|
|
8
|
International / Software / Re: Escribir Binario fácil
|
on: May 23, 2012, 01:56:54 pm
|
|
No, no. Quizas no me exprese bien, yo quiero escribir cualquier numero entre 0 y (2 a la N)-1, en binarios con N igual al numero de bits q tenga. Por eso decia de pasarlo a binario. Quizas hay algun metodo para escribir un numero cualquiera en binario sin hacer las divisiones.
|
|
|
|
|
9
|
International / Software / Escribir Binario fácil
|
on: May 23, 2012, 12:57:18 pm
|
Hola, necesito para controlar una fuente de corriente digital. Para eso quiero escribir un número via serial y que un arduino mega me lo escriba digitalmente: ejemplo si el serial dice 1 quiero que mi salida en 10 puertos digitales sea LOW LOW LOW....HIGH, si dice 2 LOW LOW..... HIGH LOW y así para cualquier número. ¿Hay alguna forma de hacer esto sin escribir las tediosas divisones necesarias para pasar un número a binario? Leí http://www.arduino.cc/playground/Code/BitMath pero no me quedó del todo claro qué código usar. Gracias
|
|
|
|
|
12
|
Using Arduino / General Electronics / PWM on a high power led
|
on: May 13, 2012, 01:02:44 pm
|
|
Hi, I have a high power led (3W) that already has a constant current power supply(700mA). I've tested that power supply and it's fast, it can be turned on and off in some miliseconds, and it works with any voltage from 4 to 15V. How can I drive it with a digital PWM signal? I need something like a relay but faster.
Thanks and sorry for my English
|
|
|
|
|
14
|
Topics / Science and Measurement / Digital input frecuency??
|
on: February 10, 2012, 02:45:22 pm
|
|
Hi, my name is Nahuel and I want to make a proyect. I have digital pulses of 50microsec of duration that came from a detector. It's not regular pulses, the only thing that I know is that the signal will be in high for 50micosec but could be 100 pulses in 1s or 3 pulses in 1s. I wan't to make a counter that say's the number of pulses in one second. I don't know how fast is the digital read, how many samples it takes?
Thanks and sorry for my English
|
|
|
|
|