| Arduino Forum ::  Members :: altagest
 Show Posts Pages: [1] 2 3 4
 1 Using Arduino / Sensors / Re: Sensor that gives PWM reading in pulse train on: October 28, 2013, 12:42:56 pm It's from a sensor which measures 3 different properties calculated this way:Code:Measure1 = ((pwm[0]%-32)/3)*10Measure2 = (((pwm[1]%-20)/(pwm[2]%-20))*0.7)*120Measure3 = (pwm[2]%-8)/12Pulse chain is given as the diagram posted says. So, I think that, if the values are given %, it talks about duty cycle.
 2 Using Arduino / Sensors / Re: Sensor that gives PWM reading in pulse train on: October 28, 2013, 07:43:50 am I don't know if those datas are correct, but let's assume they are ok.So basically, if I understand correctly, the values I get are the duty cycle?
 3 Using Arduino / Sensors / Re: Sensor that gives PWM reading in pulse train on: October 28, 2013, 06:31:01 am Mmm.... changing to that values gives me:Code:PWM 0=39PWM 1=38PWM 2=20
 4 Using Arduino / Sensors / Re: Sensor that gives PWM reading in pulse train on: October 28, 2013, 06:07:29 am Ah, it went away to me too! Corrected, but I still get the same:Code:PWM 0=0PWM 1=0PWM 2=0
 5 Using Arduino / Sensors / Re: Sensor that gives PWM reading in pulse train on: October 28, 2013, 05:50:45 am ...and I get 0 again:Code:PWM 0=0PWM 1=0PWM 2=0PWM 0=0PWM 1=0PWM 2=0PWM 0=0PWM 1=0PWM 2=0PWM 0=0PWM 1=0PWM 2=0PWM 0=0PWM 1=0PWM 2=0PWM 0=0PWM 1=0PWM 2=0PWM 0=0PWM 1=0PWM 2=0PWM 0=0PWM 1=0PWM 2=0PWM 0=0PWM 1=0PWM 2=0PWM 0=0PWM 1=0PWM 2=0
 6 Using Arduino / Sensors / Re: Sensor that gives PWM reading in pulse train on: October 28, 2013, 05:21:42 am Nice, this is what I get:Code:Lettura 0=45196Lettura 1=44724Lettura 2=23212Lettura 0=45196Lettura 1=44584Lettura 2=23232Lettura 0=45196Lettura 1=44748Lettura 2=23208Lettura 0=45200Lettura 1=44584Lettura 2=23212Lettura 0=45200Lettura 1=44724Lettura 2=23232Good! We get results. Now I need to calculate PWM1, PWM2 and PWM3. That is simply done by this:PWM1 = T1 / TPWM2 = T2 /TPWM3 = T3/TThat way we designed PWM signal definition. Then, T1 is the total time subtracted the time that signal stays LOW. Am I correct? I think this is already done in the code. Right?
 7 Using Arduino / Sensors / Re: Sensor that gives PWM reading in pulse train on: October 28, 2013, 04:42:06 am Done, but i get this:Code:Lettura 0=0Lettura 1=0Lettura 2=0Lettura 0=0Lettura 1=0Lettura 2=0Lettura 0=0Lettura 1=0Lettura 2=0Lettura 0=0Lettura 1=0Lettura 2=0Lettura 0=0Lettura 1=0Lettura 2=0Lettura 0=0Lettura 1=0Lettura 2=0Lettura 0=0Lettura 1=0Lettura 2=0Lettura 0=0Lettura 1=0Lettura 2=0Lettura 0=0Lettura 1=0Lettura 2=0Lettura 0=0Lettura 1=0Lettura 2=0Lettura 0=0Lettura 1=0Lettura 2=0
 8 Using Arduino / Sensors / Re: Sensor that gives PWM reading in pulse train on: October 28, 2013, 04:22:04 am That's what I get:Code:Low=44724 High=71020Low=43992 High=71156Low=22616 High=1249748Low=44004 High=71020Low=43992 High=71156Low=22628 High=1249764Low=44000 High=71020Low=44000 High=71164Low=22624 High=1249824Low=44004 High=71012Low=43992 High=71156Low=22620 High=1249804Low=44004 High=71024Low=43992 High=71156Low=22776 High=1249636Low=44004 High=71020Low=44136 High=71016Low=22624 High=1249764Low=44004 High=71024Low=43996 High=71156Low=22624 High=1249780Low=43996 High=71016Low=43992 High=71156Low=22640 High=1249764Low=44000 High=71020Low=44124 High=71020Low=22636 High=1249740Low=43996 High=71016Low=43984 High=71160Low=22640 High=1249744Low=44004 High=71012Low=43992 High=71156Low=22624 High=1249784Low=44004 High=71016Low=43992 High=71160Low=22784 High=1249652Low=43996 High=71020Low=43992 High=71156Low=22796
 9 Using Arduino / Sensors / Re: Sensor that gives PWM reading in pulse train on: October 28, 2013, 03:28:49 am If you take a look on the first line just below "PAUSA" in the diagram, you will see that it says1 sec + 200 msecoh wait - 1 sec + 200 msec maybe it's not 1.2 secs?
 10 Using Arduino / Sensors / Re: Sensor that gives PWM reading in pulse train on: October 28, 2013, 03:09:09 am Quote from: dc42 on October 26, 2013, 08:06:13 amLooks like no input is being received. The code I suggested assumes that you are running on an Arduino Uno and you feed the input to digital pin 2 (because that is the pin that triggers interrupt 0). Is that what you have done? Do you have a common ground between the sensor and the Arduino?Sure yes! Output from the sensor goes to Arduino digital pin 2 and there is ground in common. Maybe there's something with timing in the code? I don't think...
 11 Using Arduino / Sensors / Re: Sensor that gives PWM reading in pulse train on: October 26, 2013, 07:02:49 am dc42, thanks for the reply.Using that code i get these results from the serial monitor:Code:PWM 0=0PWM 1=0PWM 2=0what's wrong?
 12 Using Arduino / Sensors / Re: Sensor that gives PWM reading in pulse train on: October 26, 2013, 03:03:41 am Thanx dc42, that's a nice idea. If I'm not doing something wrong... and if I understood correctly, 100% duty cycle (in this case LOW signal) should be 1.200 milliseconds. If I have to do the following calculation I need:Code:PWM1 = T1/TPWM2 = T2/TPWM3 = T3/Tshould be Code:PWM1 = lettura[0] / T (T, taking a look at the wave graph above, should be 1.200 milliseconds, is that correct?)PWM2 = lettura[1]PWM3 = lettura[2]What do you think?
 13 Using Arduino / Sensors / Sensor that gives PWM reading in pulse train on: October 25, 2013, 12:12:21 pm Hi every1!I'm having a problem, already posted in Italian section, but I'm posting here so maybe the solution can be helpful to people around there. I have a sensor which makes 3 readings in a pulse train (inverted PWM signal). Here's an image that maybe explains better:As you can see, it is inverted PWM output. That's why I need to take the time of the LOW signal states.Then, I need to calculate the three different values with this simple formulas:PWM1 = T1/TPWM2 = T2/TPWM3 = T3/Tthe period of T should be 1.2 sec = 1200 milliseconds.I would like to do this with pulseIn() or interrupt, but maybe pulseIn() is much more easier. I don't have any idea on how to do this. Any ideas? Thanks!
 14 International / Software / Re: Leggere da sensore PWM on: October 25, 2013, 10:04:49 am E aggiungo: essendo che dovrei calcolare PWM1 = T1/T, da quando appare in quello schema, dovrebbe essere il tempo in cui il segnale rimane in LOW / 1.200 millisecondi... giusto?
 15 International / Software / Re: Leggere da sensore PWM on: October 25, 2013, 06:05:33 am Paolo, ti ringrazio molto. Solo che"Altrimenti sposti l'acquisizione dentro l'interrupt insieme all'indice e all'array."non riesco a capirlo, nel senso che non mi è chiaro "spostare l'acquisizione dentro l'interrupt". Non è già così?
 Pages: [1] 2 3 4