Pages: [1]   Go Down
Author Topic: Duty cycle  (Read 12223 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

California
Online Online
Faraday Member
**
Karma: 88
Posts: 3350
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

what the program I should use for this device ..

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

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17259
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 517
Posts: 26282
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 517
Posts: 26282
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Please don't cross post. Especially when your original topic is already being discussed.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks   CrossRoads
Logged

Forum Moderator
ਪੰਜਾਬ
Offline Offline
Edison Member
*****
Karma: 12
Posts: 1573
Another year! Alone! :(
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

please also don't copy and paste the same thing.
Logged

"Real Men can Accomplish  Anything"
-  Website  
- skype : nishants5  

ਫ਼ਤੇਹ ਕਰੂਂ !

Pages: [1]   Go Up
Jump to: