Go Down

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

abdelnq

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

what the program I should use for this device ..


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

retrolefty


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.


CrossRoads

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.

CrossRoads

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

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

abdelnq

thanks   CrossRoads

NI$HANT

please also don't copy and paste the same thing.
"Real Men can Accomplish  Anything"

- skype : nishants5  

ਫ਼ਤੇਹ ਕਰੁਂ!

CrossRoads

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.

NI$HANT

"Real Men can Accomplish  Anything"

- skype : nishants5  

ਫ਼ਤੇਹ ਕਰੁਂ!

Go Up