Go Down

Topic: Duty cycle (Read 40399 times)previous topic - next topic

abdelnq

Jun 06, 2014, 07:02 pm
Hi to all!
I'm trying to make a device with one input and two outputs. The input receives a rectangular signal whose frequency is from 1 to 100 Hz. before the output is activated when the duty cycle is less than 40%, if it is higher than 60% the second is 1. If there is no signal or if the signal is squared, the two outputs to 0,what the program I should use for this device .. THANKs

Arrch

#1
Jun 06, 2014, 07:04 pm
what the program I should use for this device ..

One that does what you describe. What have you tried?

retrolefty

#2
Jun 06, 2014, 07:29 pm

Hi to all!
I'm trying to make a device with one input and two outputs. The input receives a rectangular signal whose frequency is from 1 to 100 Hz. before the output is activated when the duty cycle is less than 40%, if it is higher than 60% the second is 1. If there is no signal or if the signal is squared, the two outputs to 0,what the program I should use for this device .. THANKs

The one you create and write for the arduino. The board does nothing if you don't program it to do what you wish.

#3
Jun 06, 2014, 07:34 pm
Use the pulseIn( ) command to measure the high and low times of the signal.
Add the two together to determine the period,
compare one to the period to determine the duty cycle.
Once you know those, digitalWrite (pinX, HIGH); or digitalWrite (pinX, LOW); for the outputs.

Start at the Reference tab and Learning tab above.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

#4
Jun 06, 2014, 08:02 pm
Please don't cross post. Especially when your original topic is already being discussed.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

abdelnq

#5
Jun 06, 2014, 08:43 pm
Hi to all!
I'm trying to make a device with one input and two outputs. The input receives a rectangular signal whose frequency is from 1 to 100 Hz. before the output is activated when the duty cycle is less than 40%, if it is higher than 60% the second is 1. If there is no signal or if the signal is squared, the two outputs to 0, How can I write this program foe arduino .. THANKs

#6

Nishant_Sood

#7
Jul 19, 2014, 09:58 pm
please also don't copy and paste the same thing.
"Real Men can Accomplish  Anything"

- skype : nishants5
ਫ਼ਤੇਹ ਕਰੁਂ!
www.winacro.com

#8
Jul 25, 2014, 10:31 pm
He didn't Nishant, that was left after a merge of 2 topics.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Nishant_Sood

#9
Jul 25, 2014, 10:47 pm
Okay Sir.
"Real Men can Accomplish  Anything"

- skype : nishants5
ਫ਼ਤੇਹ ਕਰੁਂ!
www.winacro.com

Go Up